Skip to Content

Store all changes as a sequence of events; current state = event replay.

Data Flow

events (immutable log):
  BankAccountOpened(id=42, owner=Alice)
  MoneyDeposited(id=42, amount=100)
  MoneyWithdrawn(id=42, amount=30)

  current balance = sum(amount) where event.account=42   = 70

When to use

Pitfalls

Analogy

A ledger that records every transaction. The current cash balance is the sum of all lines, not a single “balance” row.

Interview tip: Mention snapshots to bound replay cost.

Advertisement