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

Zero to Microservices

Zero to Microservices

Ebf974e0dbcfe88c508df6f395661a4b?s=128

Mark Wolfe

April 07, 2015
Tweet

Transcript

  1. Zero To Micro Services

  2. Overview • Martin Fowler Micro Services • Application is a

    suite of small services • communicate with lightweight mechanisms, often REST
  3. 12 Factor Apps • Store config in the environment •

    Treat backing services as attached resources • Execute the app as one or more stateless processes
  4. Functional Detail • Routing • Validation • Persistance • Authentication

    • Testing
  5. Where do we start? • From the API end •

    Build the API you want to talk too • Use the API as the basis for your service • Re use the API as the interface to your Datastore
  6. Do we need to build all this? • Locate similar

    open source projects • Review Licence • Build on their foundation • Read a lot of Code • Start small and work your way up
  7. Code • Lets look under the bonnet of a service

    that uses this structure.
  8. Implementation: DRY’er • No frameworks • Use interfaces • High

    quality API Client as a side affect • Sharing parameter structs between layers
  9. In Review • Learnt a ton building both the buildkite

    and assembly prototype • Need to replace the http.Handler routines with negoni + middleware + authentication anyone?! • Lots of things to rejig around that (delete some code). • Move some of the test helpers out into a library
  10. Questions?

  11. Links • 12 Factor Applications • assembly - REST API

    based on this talk • go-buildkite - Client API build using a similar model • thesrc - A bigger example by sourcegraph • go-sourcegraph - Client API also using this model