Why I enforce my ledger's invariant twice
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

Search for a command to run...

Series
A 6-week, build-in-public series. I'm building a production-style double-entry ledger API in Go and Postgres, with a React dashboard and a small marketplace demo on top. One post every Sunday
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

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

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

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

A play button and a load-test button, and the invariant that survives both.
