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

Zero to Microservices

Zero to Microservices

Mark Wolfe

April 07, 2015
Tweet

More Decks by Mark Wolfe

Other Decks in Programming

Transcript

  1. Zero To Micro Services

    View Slide

  2. Overview
    • Martin Fowler Micro Services
    • Application is a suite of small services
    • communicate with lightweight mechanisms, often
    REST

    View Slide

  3. 12 Factor Apps
    • Store config in the environment
    • Treat backing services as attached resources
    • Execute the app as one or more stateless processes

    View Slide

  4. Functional Detail
    • Routing
    • Validation
    • Persistance
    • Authentication
    • Testing

    View Slide

  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

    View Slide

  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

    View Slide

  7. Code
    • Lets look under the bonnet of a service that uses this
    structure.

    View Slide

  8. Implementation: DRY’er
    • No frameworks
    • Use interfaces
    • High quality API Client as a side affect
    • Sharing parameter structs between layers

    View Slide

  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

    View Slide

  10. Questions?

    View Slide

  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

    View Slide