Catalogue / river-2026-ledger-rebuild

River rebuilds its money ledger as append-only double-entry events behind two functions and migrates account by account with dual writes

River, 2026. Ledger tracking client dollars and bitcoin.

Organisation
River
Evidence
Reported from production
Source
We replaced our ledger with two functions

River, published 2026-08-19

Records

Decision#d1

Shrink the ledger API to two functions driven by declarative per-event rules, and move spending policy above it

Decision#d2

Enforce double entry and balance invariants in the Postgres schema, with append-only entries and one locked balances row

Decision#d3

Snapshot each account and start dual writes before backfilling six years of history

Decision#d4

Roll the new ledger out per account in shadow mode, with parity checks that fail open to the old ledger

Decision#d5

Test the ledger with fuzzed multi-event scenarios and a simulator that uses invariants and the old ledger as its oracle

Sign in to read what was chosen, what was rejected and what it cost, each with its place in the source. An account is free. The job-queue cards are open without one.