Teaching a Postgres ledger to rewind
A play button and a load-test button, and the invariant that survives both.

Search for a command to run...
A play button and a load-test button, and the invariant that survives both.

Application-scoping, cross-tenant isolation tests, and the trade-off I made over Postgres RLS.

Week 3 of 6 · Building a Double-Entry Ledger The naive approach When I built the live clock for my dashboard's header, the first thing I reached for was a single useState: const [now, setNow] = useSt

The naive answer to "what was my cash balance on March 15?" is one line of SQL: SELECT SUM(...) FROM entries WHERE account_id = $1 AND created_at <= '2026-03-15'; That works for one currency. In doll

The naive approach When I started thinking about how to track balances, the first thing I reached for was a single UPDATE: UPDATE accounts SET balance = balance + 100 WHERE id = 42; It works. Unt
