Topic · 4 posts

PostgreSQL

PostgreSQL can do much more than store rows. These posts show how its locks, queues and transactions solve real backend problems. Start with locks, then move on to queues and the outbox.

Start here

All PostgreSQL posts

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.

Idempotency Keys Explained: How to Make API Retries Safe

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.

Postgres as a Job Queue: How SKIP LOCKED Works (and When It Breaks)

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.

PostgreSQL Locks Explained: How to Find and Fix Blocking Queries

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.

Other topics