Building a Bank with Go - Golang UK 2015

67f4a8f2a209a38d7242829947b26ba3?s=47 mattheath
August 21, 2015

Building a Bank with Go - Golang UK 2015

Large banking systems are incredibly dated, often as a result of a series of mergers between banks, leading to a patchwork of different systems & technologies. As a result, the pace of innovation in the banking industry has slowed to a crawl. At Mondo we are 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 are developing new core banking systems from scratch backed by a microservice based platform written in Go, running across multiple data centres using tools including Docker and Mesos. We also look at why Go is perfectly suited to this, our architectural decisions, common pitfalls to avoid, and lessons learnt when developing high volume, low latency, distributed Go applications.

67f4a8f2a209a38d7242829947b26ba3?s=128

mattheath

August 21, 2015
Tweet

Transcript

  1. BUILDING A BANK
 WITH GO @mattheath Golang UK Conference 2015

  2. @mattheath

  3. Mondo

  4. None
  5. 1895

  6. monoliths traditional dev

  7. None
  8. M

  9. M

  10. TIME FOR A NEW
 KIND OF BANK?

  11. None
  12. None
  13. None
  14. None
  15. None
  16. You're doing quite well

  17. None
  18. None
  19. None
  20. the majestik møøse

  21. the majestik moose

  22. sıkısınca

  23. sikisinca

  24. None
  25. None
  26. DATABASE APPLICATION

  27. DATABASE APPLICATION

  28. DATABASE DATABASES APPLICATION

  29. DATABASE DATABASES APPLICATION SEARCH

  30. DATABASE DATABASES APPLICATION CACHE SEARCH

  31. DATABASE DATABASES APPLICATION CACHE SEARCH CAT GIFS

  32. ALL HAIL THE MONOLITH

  33. DO NOT WANT

  34. DATABASE DATABASES MONOLITH CACHE SEARCH CAT GIFS

  35. MONOLITH

  36. None
  37. None
  38. SINGLE RESPONSIBILITY BOUNDED CONTEXT WELL DEFINED INTERFACES COMPOSABILITY

  39. LOAD BALANCER

  40. LOAD BALANCER HTTP API & ROUTING LAYER

  41. SERVICE TRANSPORT LOAD BALANCER HTTP API & ROUTING LAYER

  42. SERVICE SERVICE SERVICE TRANSPORT LOAD BALANCER HTTP API & ROUTING

    LAYER
  43. SERVICE SERVICE SERVICE TRANSPORT DATABASE DATABASE DATABASE LOAD BALANCER HTTP

    API & ROUTING LAYER
  44. SERVICE SERVICE SERVICE TRANSPORT DATABASE DATABASE DATABASE LOAD BALANCER DATACENTRE

    n HTTP API & ROUTING LAYER
  45. SERVICE SERVICE SERVICE TRANSPORT DATABASE DATABASE DATABASE LOAD BALANCER HTTP

    API & ROUTING LAYER DATACENTRE n
  46. None
  47. gRPC Go KIT Kite go-micro

  48. mondough/typhon mondough/mercury

  49. LOGIN
 API LOAD BALANCER HTTP API & ROUTING LAYER

  50. LOGIN
 API AUTH SERVICE PERMS SERVICE LOAD BALANCER HTTP API

    & ROUTING LAYER
  51. LOGIN
 API AUTH SERVICE PERMS SERVICE LOAD BALANCER HTTP API

    & ROUTING LAYER ACCOUNT SERVICE
  52. LOGIN
 API AUTH SERVICE PERMS SERVICE LOAD BALANCER HTTP API

    & ROUTING LAYER ACCOUNT SERVICE FEED SERVICE
  53. LOAD BALANCER HTTP API & ROUTING LAYER ? ? ?

    ? ?
  54. Logic Handler Storage SERVICE

  55. mercury Logic Handler Storage SERVICE

  56. mercury Logic Handler Storage libraries SERVICE

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

    }) srv.Server().AddEndpoints( handler.Create, handler.Read, handler.List, ) srv.Run() }
  58. 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) }
  59. func main() { srv := service.Init(service.Config{ Name: "service.account", Description: "boop",

    }) srv.Server().AddEndpoints( handler.Create, handler.Read, handler.List, ) srv.Run() }
  60. type Endpoint struct { Name string Handler Handler Request interface{}

    Response interface{} } type Handler func(req mercury.Request) (mercury.Response, error)
  61. func main() { srv := service.Init(service.Config{ Name: "service.account", Description: "boop",

    }) srv.Server().AddEndpoints( handler.Create, handler.Read, handler.List, ) srv.Run() }
  62. 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) }
  63. type Transport interface { Tomb() *tomb.Tomb Ready() <-chan struct{} Listen(serviceName

    string, inboundChan chan<- message.Request) error StopListening(serviceName string) bool Respond(request message.Request, response message.Response) error Send(req message.Request, timeout time.Duration) (message.Response, error) }
  64. type Transport interface { Tomb() *tomb.Tomb Ready() <-chan struct{} Listen(serviceName

    string, inboundChan chan<- message.Request) error StopListening(serviceName string) bool Respond(request message.Request, response message.Response) error Send(req message.Request, timeout time.Duration) (message.Response, error) }
  65. api api api.customer api.customer service.customer service.customer

  66. 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) }
  67. type ClientMiddleware interface { ProcessClientRequest(req mercury.Request) mercury.Request ProcessClientResponse(rsp mercury.Response, ctx

    context.Context) mercury.Response ProcessClientError(err *terrors.Error, ctx context.Context) } type ServerMiddleware interface { ProcessServerRequest(req mercury.Request) (mercury.Request, mercury.Response) ProcessServerResponse(rsp mercury.Response, ctx context.Context) mercury.Response }
  68. type Context interface { Deadline() (deadline time.Time, ok bool) Done()

    <-chan struct{} Err() error Value(key interface{}) interface{} }
  69. api api api.customer api.customer service.customer service.customer

  70. api api api.customer api.customer service.customer service.customer SEND RECV SEND RECV

    RECV SEND RECV SEND
  71. mondough/phosphor mondough/phosphord

  72. PhosphorD Service A Trace Library goroutine chan UDP Service B

    Trace Library goroutine chan UDP PHOSPHOR HOST INSTANCES PUBLISH DASHBOARD AGGREGATION PERSISTANCE
  73. None
  74. None
  75. mercury Logic Handler Storage libraries SERVICE • PROVISIONING • SERVICE

    DISCOVERY • CONFIGURATION • MONITORING • AUTHENTICATION/AUTHORISATION • AB TESTING • SELF CONFIGURING CONNECTIVITY 
 TO THIRD-PARTY SERVICES
  76. None
  77. SCRATCH STATIC SSL

  78. DEALING WITH 
 COMPLEXITY

  79. TESTING

  80. LOAD FAILURE DEGRADATION

  81. MONITORING

  82. type Checker func() (err error, metadata map[string]string)

  83. MONITOR YOUR BUSINESS LOGIC

  84. None
  85. DISTRIBUTED
 TRACING

  86. None
  87. None
  88. SMALL SIMPLE EASY TO LEARN

  89. CONCURRENCY NETWORKING INTERFACES

  90. DOWNSIDES?

  91. STARTING WITH MICROSERVICES?

  92. THANKS! @mattheath @getmondo Join our Alpha at getmondo.co.uk! Feedback: joind.in/14960

  93. CREDITS ATM: Thomas Hawk
 IBM System/360: IBM Absorbed: Saxbald Photography

    Orbital Ion Cannon: www.rom.ac Go Gophers: Renee French Control Room: NASA ATM Failure: George Redgrave