- Hi, I'm Gerardo from AWS.
- And I'm Luke from Monzo and "This Is My Architecture."
- So today we're gonna talk
about Monzo's core banking platform.
What can you tell me about this platform?
- So to just give you an introduction to Monzo.
So we're a bank,
a fully regulated bank operating in the UK currently.
We've got around eight million customers
and that's a mix of current account customers
and business customers.
And we were founded in 2015 with a mission
to make money work for everyone.
So one of the key architectural principles we've taken
to build our platform mainly
is that we've got global ambitions as a bank.
So we've gotta build a global platform to take us there.
- Great. So let's dive in.
So if this is a banking platform,
presumably you have payments flowing through this.
- Yes. (Gerardo chuckling)
How about you take me through the journey of a payment?
- Yeah, good.
So if we use the example
of maybe you're a Monzo customer
and you're picking up your morning coffee from a coffee shop
on the way into work in the morning.
You've just got to the till and order from the barista,
and you've just been charged $3,
and you tap your card on the payment terminal in the shop.
So that payment gets routed through one
of our payment schemes through our physical data centers
into our AWS Direct Connect.
And then that ends up in our core banking platform.
- Okay, so this is how
you're getting transaction information
and presumably credit card information?
- Yep.
- Okay. What happens next?
- Yeah, so at this point,
we don't wanna be passing any sensitive card details
through our platform.
So that hits our tokenization service
and this just removes all sensitive information
so you're just dealing with a token
rather than an actual card number.
- Okay.
Presumably these are microservices
'cause I see that you're pairing some
of these services with databases.
- Yes. Yeah, that's right.
So we've got about 2,600 microservices
on our platform at the moment,
which are all within Kubernetes, so EKS,
and the basic flow here is that every microservice
that needs to store state will have a database associated
with it, which we store in Keyspaces.
- [Gerardo] Okay.
- [Luke] So to talk you through the basic flow,
once you've made sure
that there's no sensitive information being passed
around the platform is that we will make sure
that that card is a valid card, that it's not blocked,
it's not frozen for any reason.
And we do that by making a call
over to our backend data store in Keyspaces
to make sure that that card exists.
- [Gerardo] Okay.
- Once we know that that's fine,
we make sure that card is associated with an account,
which again, we do another check,
which is basically a read against that data store.
And then the final thing is to make sure
that as a customer, you actually have enough money
to make the purchase for your coffee in the morning.
And then we do some basic calculations on your ledger there.
- Okay, and if everything's good,
I'm guessing that you confirm the payment.
- That's it. - Okay.
- So this flow is all synchronous,
so we've got a small number of seconds
to be able to return a response to the payment terminal.
So that just goes straight back out
with their yes or no decision
about whether we can process this transaction or not.
- So presumably this whole architecture
is architected around speed.
How does Cassandra play a part in that speed?
- Yeah, so the synchronous flow,
low latencies are super important for us
and the overall performance of the platform
is super important.
When we decided to use Cassandra
as our data store when we were building the bank,
there were two key things that we were looking for.
One of them is that we could horizontally scale the service
in future as we build the business
and take on more customers,
and that could also go multi-region.
And then secondly is that it needed to be fast.
- Yes. Okay.
You've been operating on a Cassandra platform
for a while, even before Keyspaces was available.
So tell me about it.
What were some of the challenges you had
and tell me about your decision to move to Keyspaces.
- Yeah, so when we looked at the total cost
of ownership of running our own Cassandra environments,
we used to manage Cassandra directly on top of EC2.
- Yeah.
- And we found that as the business was scaling,
we were just spending more and more time
doing routine operations, like scaling our clusters out.
And the blush radius of incidents
when they happened was actually quite large
where you ran into problems around noisy neighbors.
And when we looked at the Keyspaces products
that gave us really, really good performance guarantees
around a super low single second,
single millisecond latencies.
- Okay.
- And it ticked the boxes with scaling in future.
- Okay, what sort of scale are you running in Keyspaces?
- At peak at the moment,
we are running about two million reads
per second against Keyspaces
and about 100,000 writes per second.
- So how about any limitations around Cassandra?
'cause obviously with these sort of NoSQL databases
that scaled really well horizontally,
you can bump into challenges with consistency.
Are you having any issues around that?
- We've solved the problems largely.
We're running our ledger on Keyspaces
and some of the guarantees that you need
to provide over a ledger,
like super important if you're a bunk.
So we've had to solve the problem
around double entry bookkeeping ourselves
by building transaction services
and a number of other microservices
just so we get the guarantees that we need.
- Great, that's good to hear.
Okay, so this VNA core backing platform,
and you mentioned that you're highly regulated in the UK,
so how does security play a part in the architecture?
- Yeah, so security, you can't run a bank successfully
without having like strong security guarantees.
So we use a couple of different AWS services
to help secure our platform.
We've got things the WAF externally,
but then within the platform as well,
we make use of things AWS CloudTrail.
And then we've also got some fairly novel use cases
with AWS Nitro Enclaves.
- Great, presumably to create some isolated environments.
- It's like isolating one client, yeah.
- That's good to hear.
So Luke, thank you so much
for sharing this architecture with us.
- Thank you for having me.
- And thank you for watching "This Is My Architecture."
See you next time.
(lively music)