Free sample lesson ยท Multi-Model Banking System Architecture
Double Entry
How do modern banking platforms ensure money never disappears into thin air?
Lesson 1 of the Wondering course Multi-Model Banking System Architecture
Money Never Vanishes
Ask a banking engineer where money goes during a transfer, and the honest answer is nowhere. It moves.
In a multi-model banking architecture, the ledger is the single source of truth. Every movement of value is recorded twice: once leaving, once arriving.
- Debit entry
- Credit entry
That paired record is what keeps the system honest and auditable.
Beyond Simple Balance Updates
Many beginners model a transfer as two independent updates: subtract here, add there.
Double-entry replaces that with a system of immutable transaction logs. Balances become a consequence of recorded entries, not the thing you edit directly.
- Balance increments
- Double entry
The difference matters when something goes wrong.
Every Kind Of Movement
The rule does not bend for the payment type.
A domestic PIX transfer, a cross-border wire, and a crypto-to-fiat exchange are all recorded the same way: as a balanced pair of entries.
One shape, many asset classes. That uniformity is what makes reconciliation possible later.
Atomic Or Nothing
In high-concurrency environments, two entries can race each other.
Developers use distributed locking or multi-version concurrency control (MVCC) so the debit from one account and the credit to another happen atomically.
- Transfer request
- Apply concurrency control: Distributed locking or MVCC guards the accounts.
- Prepare entry pair: One debit and one matching credit.
- Both entries land?
- Commit atomically
- Retry
Either both land, or neither does. There is no valid state in between.
The Lost Update Problem
Without this discipline, concurrent writes overwrite each other. One update wins, the other disappears silently.
The double-entry pattern prevents that lost update problem.
It also means that after a partial system failure, the ledger can still be reconciled back to a consistent state.
An Append-Only Log
Treat the ledger as an append-only log of events. Entries are added, never rewritten.
That single decision creates the foundation for complex financial operations built on top.
- Real-time settlement: Settlement across disparate asset classes.
- Currency conversion: Automated conversion between currencies.
- Balanced entry pairs: Every movement recorded as a debit and a credit.
- Append-only log: Events are added, never rewritten.
Each level rests on the one below
Automated currency conversion and real-time settlement across disparate asset classes both rest on it.
Putting It To Work
Double-entry is the immutable baseline of reliable financial records.
Record every movement as a balanced pair. Guard the write with locking or MVCC. Never edit a past entry.
- Model events: Treat the ledger as an append-only log rather than editable balances.
- Pair entries: Record every movement of value as a balanced debit and credit.
- Guard writes: Use distributed locking or MVCC so both entries commit atomically.
- Reconcile: After any partial failure, reconcile the ledger to a consistent state.
Do that, and money can never disappear into thin air. It can only be traced.
Check yourself
Does a double-entry transfer record value movement as two linked entries rather than as one balance edit?
- Yes
- No
Answer: Yes
Yes. One entry records value leaving the source account, and the corresponding entry records value arriving at the destination. Balances follow from these records.
For a transfer, the entry showing value leaving the source account is a _____, while the entry showing value arriving at the destination account is a _____.
Answer: For a transfer, the entry showing value leaving the source account is a debit, while the entry showing value arriving at the destination account is a credit.
The debit represents the outgoing side of the movement, and the credit represents the incoming side. Together they form the balanced pair.
A service processes a transfer while another request updates one of the same accounts. Which behavior best preserves atomic transaction integrity?
- Commit the debit and credit together, using locking or MVCC
- Commit the debit immediately and retry the credit later
- Update the destination balance and rebuild the source entry afterward
- Allow the last concurrent write to replace earlier entries
Answer: Commit the debit and credit together, using locking or MVCC
Atomicity requires the debit and credit to land together or for neither to land. Distributed locking or MVCC can protect the concurrent write so the ledger does not expose an incomplete transfer.
Keep going
This is lesson 1 of 10 in Multi-Model Banking System Architecture. Next up:
- Currency Exchange
- Wire Transfers
- PIX Settlement
- Crypto Custody
- Chain Listeners
Wondering turns any topic into short lessons you can read, watch, or listen to, with practice questions and an AI tutor.