Skip to main content
  1. References/
  2. Architecture Design Basics/
  3. Pattern Taxonomy/
  4. Domain-Specific Patterns/

Double-Entry Ledger

·· 168 words· 1 min

🟠 P1 — the accounting pattern underlying every financial system

Problem #

In financial systems, money must never appear or disappear. Every transaction must be traceable, auditable, and balanced.

Mechanism #

Every financial event creates two entries that sum to zero:

Customer pays $100 for a product:

  Debit:  Customer Account  -$100
  Credit: Merchant Account   +$100
  ─────────────────────────────────
  Net change:                  $0

Properties #

  • Conservation: Sum of all debits and credits is always zero (money doesn’t appear/disappear)
  • Auditability: Every balance change has a corresponding counter-entry
  • Immutability: Entries are append-only. Corrections are new reversing entries, not updates.
  • Reconciliation: Sum all entries for an account to reconstruct balance at any point in time

Instinct #

For any system that handles money, model it as a double-entry ledger from day one. It’s more work upfront than a simple balance column, but it gives you: (1) full audit trail, (2) easy reconciliation, (3) natural support for holds/refunds/disputes as additional entries. This pairs naturally with Event Sourcing — the ledger IS an event log.

References #