How Monzo leveraged AWS and Kubernetes to build an agile retail bank

AWS was key in helping Monzo to comply with the heavy regulations needed to gain a banking licence

The retail banking industry has been one of the most heavily regulated in the UK for decades. It wasn't until the early 2010s that the restrictions were eased, following several government inquiries that criticised the lack of competition in the sector.

Metro Bank was launched in 2010, becoming the first company to gain a banking licence in 100 years. Since that time, several new startups have moved through the process with help from the Financial Conduct Authority (FCA), hoping to challenge the big four: Barclays, HSBC, Lloyds and RBS.

One of those new ‘challenger banks' is Monzo, formed in 2015 (and licensed since 2017) by a group who met while working at now-competitor Starling.

Everything at Monzo, from money transfers to customer service, is done through the bank's app: a very 21st-century approach, but one that Monzo has so far struggled to succeed with; losses last year quadrupled to £33.1 million. The Financial Times reports that this was due to the relatively low amounts of money that people deposit in their Monzo accounts, as they're hesitant to leave the institutions that they've known their entire lives.

Monzo works solely through its mobile app - no branches, and no legacy systems

"It is incredibly, incredibly difficult [to get past customer inertia]," said Chris Evans, Platform Team Lead at the firm. "Rightly or wrongly, people have strong emotional attachments to the bank that they've grown up with."

There is no doubt that moving to Monzo, Starling, Atom or any of the other new challengers, although simplified through the Current Account Switching Service (CASS), requires an adjustment in one's thinking. They have no physical branches, and core legacy banking systems are a thing of the past.

There was a doubt as to whether we'd ever actually be able to run a viable bank in the cloud - Chris Evans, Platform Team Lead at Monzo

Monzo's systems are all built on AWS EC2, due to the reliance on compute power. Kubernetes runs on top, and the bank runs on top of that.

"When the company first started, the engineers that were building the bank started building on AWS...but there was a doubt as to whether we'd ever actually be able to run a viable bank in the cloud, and moreover the whole regulator thing was a tricky part for them," said Evans.

At around the time the founders were building Monzo, the FCA started talking to AWS, which resulted in the removal of a lot of pressure around the regulation aspect:

"One of the initial reasons Monzo chose AWS was the need to comply with banking regulations. In November 2015, the FCA...released guidelines for banks using off-premises cloud services. Partly because the FCA had awarded a contract to AWS for its own needs, Monzo decided AWS had the credentials to host an FCA-regulated workload."

How Monzo leveraged AWS and Kubernetes to build an agile retail bank

AWS was key in helping Monzo to comply with the heavy regulations needed to gain a banking licence

Migrating from Mesos

Monzo uses Kubernetes as a cluster manager to handle containers, which it switched to after about a year of Mesos and Marathon.

"Essentially, [Mesos+Marathon] doesn't have the same community backing," said Evans; "it's still lacking in a number of features, and Kubernetes is becoming almost the de facto standard: the de facto way to run containers in production. It just has such a rich ecosystem of tools and it's such a powerful piece of software...

"Running a bank on top of Kubernetes is something that, if you'd asked me about a few years ago, I'd have laughed at you about. People weren't running retail websites on Kubernetes because it wasn't production ready. It's an incredible position to be in, that we can run such a regulated and complex system on top of it."

The results speak for themselves: production infrastructure costs are down to about a quarter of what they were before the switch, and efficiency is much higher.

A mesh of microservices

The bank's architecture is built not as a centralised application or core legacy system, but a collection of microservices enabled by Kubernetes. ‘Daily batch processes, single points of failure, and maintenance windows are not acceptable in a world where customers expect 24x7, always-on access to their money, and where we want to roll out new features in a matter of hours, not months,' the company said in a 2016 blog post.

Monzo customers can control their money in the app, separating it into protected pots

Running microservices (around 500 at the time of writing) means high levels of scalability, but "it's a double-edged sword," Evans told us.

"The benefits that you get are great, in that you get things that are able to work on very small parts of code that are very well isolated, easy to develop and iterate on and deploy very rapidly.

"The cost that you have for that is that in the traditional days of a monolith you would have one process running in one big monolithic app; the function calls would be super-cheap and almost guaranteed to be reliable. As soon as you enter into the microservices realm, you end up in a world where you can almost guarantee that the interactions between your services are not reliable."

Monzo solves that with a Linkerd service mesh, which increases reliability by handling the communications on the network.

"We proxy all requests through Linkerd. A service essentially talks to local hosts on whatever machine it is, [then] goes off and Linkerd will do service discovery to find out where it needs to route that request to, and attempt to route it; if it fails...it then handles retrying that and circuit breaking and all those other things that help to run and operate microservices.

"What that means is that as an app developer, you can write microservices under the assumption that...your request is guaranteed to succeed, because something else is taking care of making sure that that is the case."

For a company with only about 300 employees, Monzo has been making outsized waves in the retail banking space with some strong technical partnerships and a modern approach to its both back- and front-end systems, in a sector that is traditionally seen as being dominated by legacy.

In the future Monzo could offer more traditional banking services like interest rates, although this would be done through partnerships; effectively an account with a different bank, opened through the Monzo app. For now, though, the core mission remains the same: "It's all about making money work better for people."