The Transactional Outbox Pattern, Explained Simply
How the transactional outbox pattern fixes the dual write problem, with diagrams, Postgres SQL, polling vs CDC, ordering, duplicates and the metric to watch.
I write about whatever catches my attention. Lately that's mostly databases and how backends hold up under load.
Start with the series →New posts also come out on the RSS feed.
How the transactional outbox pattern fixes the dual write problem, with diagrams, Postgres SQL, polling vs CDC, ordering, duplicates and the metric to watch.
What idempotency keys are, why every payments API uses them, and how to build them on the server with Postgres, with diagrams, SQL and common mistakes.
How to build a reliable job queue in PostgreSQL with FOR UPDATE SKIP LOCKED, with copy-paste SQL, diagrams, and the three ways it breaks in production.
SQLite in production: the PRAGMA settings, WAL mode, one-writer pattern, checkpoints and Litestream backups for a busy site, and when to pick Postgres.
PostgreSQL locks explained: how one slow SELECT and a quick ALTER TABLE can stop a site, how to find blockers with pg_locks, and how to migrate safely.
Learn how SQLite indexes work. Read EXPLAIN QUERY PLAN, then fix a slow query step by step with composite, covering, partial and expression indexes.
How SQLite locking works, why you get 'database is locked' (SQLITE_BUSY) even with a busy timeout, and how WAL mode and BEGIN IMMEDIATE fix it.