RRRithvik Ronaldoinrithvikronaldo.dev10Adding multi-tenancy to a Postgres ledger without a rewrite2d ago · 8 min read · For three weeks, every row in this ledger has had org_id = 1. That was a Week 1 decision. Build the schema, the double-entry invariants, the snapshots, the FX layer — all under a single hardcoded org.Join discussion
RRRithvik Ronaldoinrithvikronaldo.dev00Streaming a ledger without melting ReactMay 10 · 6 min read · 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] = useStJoin discussion
RRRithvik Ronaldoinrithvikronaldo.dev00What was my cash balance on March 15? In dollars?May 3 · 7 min read · 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 dollJoin discussion
RRRithvik Ronaldoinrithvikronaldo.dev50Why I enforce my ledger's invariant twice Apr 26 · 7 min read · 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. UntJoin discussion