At QCon London Matt Heath presented 'Building a Bank with Golang'. Heath discussed how Monzo Bank has created their backend systems designed with a microservices architecture and implemented using Google's Golang. Key takeaways included: Golang's excellent concurrency primitives making this a language well-suited for creating 'high volume, low latency, distributed applications'; the use of a microservices framework like Monzo's open source 'Typhon' framework in combination with the CNCF 'linkerd' proxy, being highly beneficial for implementing core communication concerns; and enabling distributed tracing through context propagation being a key enabler for observability and debugging distributed systems.
Heath, a Distributed Systems Engineer at Monzo Bank, began the talk by introducing Monzo's goal of disrupting retail banking, and their particularly focus on offering current account management via a mobile application with modern UX. Monzo is a new entrant into the UK banking sector, and gained a banking licence with restrictions in August 2016. When the company was formed in February 2015, the technical team decided to avoid using a monolithic application design, due to the known requirements of scaling both the technology and teams building the Monzo backend applications.
The decision to build the Monzo banking application by 'starting with microservices' was made due to the properties of this architectural style, such as the philosophy of following the single responsibility principle, and easier implementation of well-defined (Domain-Driven Design inspired) bounded contexts, and interfaces/APIs. The backend services were to be implemented using Google's Golang, as this programming language platform is memory managed, statically typed, offers excellent concurrency primitives (such as goroutines and channels), and is 'perfect for simple, small, network services'.
Go is a perfect language for creating microservice architectures, and the concurrency features, and the language in general, has allowed the easy creation of small and simple networked services at Monzo that are focused around the 'single responsibility principle'.
As the number of services increased, the Monzo team realised the benefits of implementing their services using a standardised framework-like chassis. Taking inspiration from Peter Bourgon's Go-based microservices framework 'go-kit' and Asim Aslam's 'micro', the Monzo team created the open source 'Typhon': a 'transport layer for microservice [RPC] communication'. Core communication responsibilities like service discovery, load balancing, failure handling and visibility were implemented using the 'linkerd' transparent proxy (now stewarded by the CNCF).
The Monzo backend services are packaged within Docker images, and deployed onto Kubernetes. The application makes extensive use of the event-driven architecture paradigm, and shares core request information through context propagation. A correlation ID is added to all requests, and the Monzo open source 'phosphor' application is used for distributed tracing (in a similar fashion to Google's Dapper or Open Zipkin). This allows for the visualisation of a request's path through the systems, and assists with debugging:
Heath concluded the talk by stating that the Monzo technical team has found Go to be 'perfect for microservice architectures', and the concurrency features, and the language in general, has allowed the creation of 'small, simple, easy' services.
The slides from Matt Heath's talk 'Building a Bank with Go' can be found on Speaker Deck, and additional details can be found on the QCon London conference talk page.