Back to Tutorials

Fintech System Design

Specialized patterns for payment systems, ledgers, and financial platforms at scale

95 minutes
9Detailed Sections
Senior Level

Double-entry bookkeeping: every transaction creates two equal and opposite entries (debit and credit). Ensures accuracy: total debits equal total credits.

Example: user deposits $100 -> debit cash account, credit user deposit liability. For payment: debit user wallet, credit merchant account.

Ensures money never disappears. Database implementation: ledger table with account, amount, transaction ID, timestamp.

Account balances computed from ledger entries. Benefits: immutable audit trail, reconciliation.

Challenges: distributed transactions, consistency. Real-world: Stripe uses ledger model; Wise transfers; Square payments.

Ledger as source of truth; balance is derived state.

Key Takeaways

1
Core Principle: Every transaction creates debit entry and credit entry (must balance)
2
Ensures Money Conservation: Total debits always equal total credits
3
Immutable Audit Trail: Ledger entries never change; changes create new entries
4
Source of Truth: Account balance is derived from ledger, not stored
5
Prevents Errors: Double-entry catches unbalanced transactions immediately
6
Facilitates Reconciliation: Easy to verify accounts and detect fraud

Visual Diagram

Transaction -> Debit entry + Credit entry -> Ledger -> Balance (sum of entries)

Sign in to unlock

Sign In Free