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

Micro-services in Golang

Micro-services in Golang

Mark Wolfe

June 03, 2014

More Decks by Mark Wolfe

Other Decks in Programming


  1. Who is this guy? • Mark Wolfe <[email protected]> • @wolfeidau

    on twitter • github.com/wolfeidau • CTO at Ninja Blocks http://www.ninjablocks.com/
  2. What are Micro-services? • Martin Fowler Micro Services • Application

    is a suite of small services • communicate with lightweight mechanisms, often REST • Written in different programming languages • Use different data storage technologies
  3. The Art of Unix Programming • Book details 17 Rules

    these include: • Rule of Composition, build small simple programs • Summarised as Keep it Simple, Stupid (KISS) • Make each program do one thing well.
  4. Building a Micro-service • Discovery • Operational Visibility • Logging

    • Metrics • Health Checks • Deployments/Upgrades
  5. My Recipe • Logging, loggo used in Canonical’s Juju •

    Configuration, envconfig loads configuration from env • Heath checks, currently using stdlib for REST • Metrics, go-metrics port of Coda Hale's Metrics lib
  6. Where do we start? • Pull down go-bootstrap project •

    Always version.go • Start in the main.go • Add a commands.go for dispatch via michellh/cli
  7. Commands • Simple composable command line interface • Single binary

    • agent, where all the work happens • version, status, enable automation and monitoring