Double-Entry Postings

A transaction fans out into balanced postings that net to zero, then updates derived balances

Double-Entry Postings A transaction fans out into balanced postings that net to zero, then updates derived balances 01 / Transaction 02 / Postings 03 / Invariant 04 / Ledger 05 / Balances Transaction · Customer deposits 100 · 01 / Transaction · event Transaction Customer deposits 100 event Debit · Cash +100 · 02 / Postings · posting Debit Cash +100 posting Credit · Customer Liability +100 · 02 / Postings · posting Credit Customer Liability +100 posting Invariant Check · postings sum to ZERO · 03 / Invariant · reject if not Invariant Check postings sum to ZERO reject if not Ledger · append-only · 04 / Ledger · immutable Ledger append-only immutable Account Balances · derived projection · 05 / Balances · sum of postings Account Balances derived projection sum of postings debit leg +100 credit leg +100 debit posting balanced credit posting balanced sum = 0, accept committed project derived Legend primary data policy / PII async batch data store

Balancing Invariant

  • • Every transaction records equal debits and credits
  • • Entries always sum to zero before they are accepted
  • • An unbalanced set of postings is rejected, never stored

Ledger and Balances

  • • The ledger is append-only and immutable once written
  • • A balance is the sum of all postings against an account
  • • Balances are a derived projection, not a source of truth