Fintech System Design
Specialized patterns for payment systems, ledgers, and financial platforms at scale
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
Visual Diagram
Transaction -> Debit entry + Credit entry -> Ledger -> Balance (sum of entries)