How banks handle our balance, technically?

vinibrsl

Vinicius Brasil

Posted on October 20, 2018

How banks handle our balance, technically?

There's this famous database design problem about account balance. Should you store the account balance in a column, or in a table of transactions and calculate it on the fly whenever you need it?

  1. If you have an account balance column, you'll always depend on the back-end application, in database triggers or something like this to update the field.

  2. If you have a transactions table, you'll have to process a lot of data to get this information, that can cost I/O and time. That seems not to scale well.

And, in my view, both can run into concurrency issues, right?

My question is: how banks do it?

💖 💪 🙅 🚩
vinibrsl
Vinicius Brasil

Posted on October 20, 2018

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

How banks handle our balance, technically?
explainlikeimfive How banks handle our balance, technically?

October 20, 2018