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

Building Microservice Architectures with Go - Microservices Meetup Berlin

mattheath
January 28, 2016

Building Microservice Architectures with Go - Microservices Meetup Berlin

Presented at Microservices Meetup Berlin
http://www.meetup.com/Microservices-Meetup-Berlin/events/228032860/

Traditionally applications have been built as monoliths; single applications which become larger and more complex over time, which limit our ability to react to change. An example of this is the banking industry where mergers and acquisitions between banks have lead to a patchwork of different systems & technologies that cost billions of dollars per year to maintain. As a result, the pace of innovation in the banking industry has slowed to a crawl.

At Mondo we're building a new kind of bank, a smart bank that belongs in the 21st century, and we’re building it almost entirely in Go. This talk will cover how we’re developing new core banking systems from scratch backed by a microservice platform written in Go, running across multiple data centres using open source frameworks and tools including Docker and Mesos. We'll look at why Go is perfectly suited to this, our architectural decisions, common pitfalls to avoid, and how microservice architectures can vastly increase both the velocity of development teams and the scalability and fault tolerance of our systems.

mattheath

January 28, 2016
Tweet

More Decks by mattheath

Other Decks in Programming

Transcript

  1. ?

  2. func main() { srv := service.Init(service.Config{ Name: "service.account", Description: "Store

    bank accounts", }) srv.AddEndpoints( handler.Create, handler.Read, handler.List, ) srv.Run() }
  3. func main() { srv := service.Init(service.Config{ Name: "service.account", Description: "Store

    bank accounts", }) srv.AddEndpoints( handler.Create, handler.Read, handler.List, ) srv.Run() }
  4. func main() { srv := service.Init(service.Config{ Name: "service.account", Description: "Store

    bank accounts", }) srv.AddEndpoints( handler.Create, handler.Read, handler.List, ) srv.Run() }
  5. func main() { srv := service.Init(service.Config{ Name: "service.account", Description: "boop",

    }) srv.AddEndpoints( handler.Create, handler.Read, handler.List, ) srv.Run() }
  6. func main() { srv := service.Init(service.Config{ Name: "service.account", Description: "boop",

    }) srv.AddEndpoints( handler.Create, handler.Read, handler.List, ) srv.Run() }
  7. type Server interface { Name() string AddEndpoints(eps ...Endpoint) RemoveEndpoints(eps ...Endpoint)

    Endpoint(name string) (Endpoint, bool) Endpoints() []Endpoint Start(trans transport.Transport) error Run(trans transport.Transport) Stop() Middleware() []ServerMiddleware SetMiddleware([]ServerMiddleware) AddMiddleware(ServerMiddleware) }
  8. type Transport interface { Tomb() *tomb.Tomb Ready() <-chan struct{} Listen(serviceName

    string, inbound chan<- request) error StopListening(serviceName string) bool Respond(req request, resp response) error Send(req request, timeout time.Duration) (response, error) }
  9. type Transport interface { Tomb() *tomb.Tomb Ready() <-chan struct{} Listen(serviceName

    string, inbound chan<- request) error StopListening(serviceName string) bool Respond(req request, resp response) error Send(req request, timeout time.Duration) (response, error) }
  10. type Transport interface { Tomb() *tomb.Tomb Ready() <-chan struct{} Listen(serviceName

    string, inbound chan<- request) error StopListening(serviceName string) bool Respond(req request, resp response) error Send(req request, timeout time.Duration) (response, error) }
  11. type Transport interface { Tomb() *tomb.Tomb Ready() <-chan struct{} Listen(serviceName

    string, inbound chan<- request) error StopListening(serviceName string) bool Respond(req request, resp response) error Send(req request, timeout time.Duration) (response, error) }
  12. mercury Logic Handlers Storage libraries SERVICE Deployment Service Discovery Configuration

    Monitoring Authentication Authorisation Storage Circuit Breaking
  13. API SERVICE SERVICE A SERVICE B LOAD BALANCER HTTP API

    & ROUTING LAYER SERVICE C SERVICE D E
  14. API SERVICE SERVICE A SERVICE B LOAD BALANCER HTTP API

    & ROUTING LAYER SERVICE C SERVICE D G E F
  15. WEBHOOK API LOAD BALANCER HTTP API & ROUTING LAYER WEBHOOK

    SERVICE WEBHOOK SERVICE WEBHOOK SERVICE
  16. WEBHOOK API LOAD BALANCER HTTP API & ROUTING LAYER WEBHOOK

    SERVICE WEBHOOK SERVICE WEBHOOK SERVICE
  17. WEBHOOK API LOAD BALANCER HTTP API & ROUTING LAYER WEBHOOK

    SERVICE WEBHOOK SERVICE WEBHOOK SERVICE WEBHOOK SERVICE
  18. WEBHOOK API LOAD BALANCER HTTP API & ROUTING LAYER WEBHOOK

    SERVICE WEBHOOK SERVICE WEBHOOK SERVICE WEBHOOK SERVICE SLOW / ERRORS
  19. package context type Context interface { Deadline() (deadline time.Time, ok

    bool) Done() <-chan struct{} Err() error Value(key interface{}) interface{} }
  20. package context type Context interface { Deadline() (deadline time.Time, ok

    bool) Done() <-chan struct{} Err() error Value(key interface{}) interface{} }
  21. package context type Context interface { Deadline() (deadline time.Time, ok

    bool) Done() <-chan struct{} Err() error Value(key interface{}) interface{} }
  22. package context type Context interface { Deadline() (deadline time.Time, ok

    bool) Done() <-chan struct{} Err() error Value(key interface{}) interface{} }
  23. package context type Context interface { Deadline() (deadline time.Time, ok

    bool) Done() <-chan struct{} Err() error Value(key interface{}) interface{} }
  24. API card-api card-processing cards transactions balance transaction-enrichment merchant feed-generator feed

    apns API card-api card-processing cards transactions balance transaction-enrichment merchant feed-generator feed apns
  25. API card-api card-processing cards transactions balance transaction-enrichment merchant feed-generator feed

    apns API card-api card-processing cards transactions balance transaction-enrichment merchant feed-generator feed apns
  26. API card-api card-processing cards transactions balance transaction-enrichment merchant feed-generator feed

    apns API card-api card-processing cards transactions balance transaction-enrichment merchant feed-generator feed apns
  27. API card-api card-processing cards transactions balance transaction-enrichment merchant feed-generator feed

    apns API card-api card-processing cards transactions balance transaction-enrichment merchant feed-generator feed apns
  28. API card-api card-processing cards transactions balance transaction-enrichment merchant feed-generator feed

    apns API card-api card-processing cards transactions balance transaction-enrichment merchant feed-generator feed apns
  29. API card-api card-processing cards transactions balance transaction-enrichment merchant feed-generator feed

    apns API card-api card-processing cards transactions balance transaction-enrichment merchant feed-generator feed apns
  30. ATM: Thomas Hawk
 Bank of Commerce: ABQ Museum Archives IBM

    System/360: IBM Absorbed: Saxbald Photography Orbital Ion Cannon: www.rom.ac Go Gopher: Renee French Control Room: NASA ATM Failure: George Redgrave Credits