Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Go Winnipeg Meetup #3 - How Bold uses Go

Go Winnipeg Meetup #3 - How Bold uses Go

First talk at Go Winnipeg Meetup #3, How Bold uses Go

Mark St.Godard

September 18, 2019
Tweet

More Decks by Mark St.Godard

Other Decks in Programming

Transcript

  1. Go Winnipeg Meetup #3 • ⚡ Lightning Talk ◦ “How

    Bold uses Go” • Talk: ◦ “gRPC and Protocol buffer first APIs” • Wrap up ~ 6:10 pm ~ 6:45 pm ~ 7:45 pm
  2. What is Go? • Created by Google (2007) ◦ Rob

    Pike, Ken Thompson, Rob Griesemer • Open Source (2009) • Statically typed • Compiles to an executable • Garbage collected • Syntactically similar to C
  3. +

  4. Who is Bold Commerce? • eCommerce apps and services •

    90k merchants • ~20 apps • 92 developers • Can get spiky traffic
  5. Next N apps (2013-2016) Web server APP 1 APP 2

    APP 3 APP 4 APP (n) Database
  6. PHP • Most apps primarily were LAMP stack • Modern

    PHP frameworks ◦ Later started adopting Laravel • Virtual Machine ◦ Deploys to VMs, apache vhosts
  7. 2016 • Build ◦ Docker images • Deploy ◦ Kubernetes

    • Microservices ◦ Decompose based on capability
  8. How Bold uses Go • Labs project (~2016) ◦ Wifi

    marketing ◦ Firmware, compile to arch (32 bit MIPS)
  9. How Bold uses Go • Command line interfaces ◦ CLI

    to help automate Rackspace Cloud Infrastructure ◦ Dev cli to bootstrap dev envs https://github.com/spf13/cobra
  10. How Bold uses Go • Async Processing ◦ Jobs and

    queues ◦ Issues w/ Laravel jobs and RabbitMQ ◦ Performance (slow to trigger, process) • PHP process model ◦ req / response ◦ Not suited for long running processes
  11. How Bold uses Go • APIs ◦ Move to more

    API centric model & micro services ◦ Less of a benefit to using a PHP + Laravel for APIs ◦ Newer services tend to be written in Go ◦ Move to gRPC for our service definitions
  12. How Bold uses Go api gateway API 1 API 2

    API 3 API 4 API (n) https gRPC Database
  13. How Bold uses Go • Unit testing ◦ Ginkgo: https://github.com/onsi/ginkgo

    • Database / SQL ◦ Not using an ORM (like Active Record) ◦ Use squirrel for SQL building • Shopify Go Client (official) ◦ https://github.com/bold-commerce/go-shopify
  14. Summary • Pros: ◦ Simple, relatively easy to learn ◦

    Standard library vs. frameworks ◦ Concurrency ◦ Low footprint ▪ Memory, go routines, docker image size • Cons ◦ general purpose vs. less framework-y (ala Rails)
  15. Resources • A Tour of Go ◦ https://tour.golang.org • Go

    by Example ◦ https://gobyexample.com • Go Playground ◦ https://play.golang.org • Boldly Going (our technical blog) ◦ https://medium.com/boldly-going