September 18, 2026 · Diego Marín

Why we do not store balances

Every system that holds money eventually faces the same question: do you store the balance, or derive it? Storing is faster. Deriving is correct. We chose correct.

A stored balance is a summary of history kept in a column. The moment any code path touches money without also touching that column, the number is wrong — and nothing tells you. The failure is silent, which is the worst kind.

So instead of a balance field, we keep postings. Every movement writes two rows: a debit and a credit, in one transaction. The balance on the dashboard is a sum over those rows. It cannot drift, because there is nothing to drift.

The objection is always performance. In practice the query is a single indexed aggregate over an account’s postings, and it is fast enough at the volumes a retail account actually generates.

Leave a response

Your email address will not be published.

All notes