Engineering notes that show the moving parts.

Technical essays, diagrams, and interactive demos about durable systems, architecture tradeoffs, and production code.

Series

Durable Work in Postgres

A practical path from one Postgres claim loop to recovery, idempotency, competing workers, stable ownership, and cross-service handoffs.

Start with the introduction
  1. Part 1The claim loopMinimal Postgres claim loop: enqueue, SKIP LOCKED claim, complete, and handler retry with an interactive simulation. · 15 min
  2. Part 2Crash recoveryLeases, lease cleanup, at-least-once delivery, and handler idempotency for Postgres inbox workers. · 12 min
  3. Part 3Many workersMulti-worker contention, delivery guarantees, and per-key ordering before consistent hash. · 15 min
  4. Part 4Partitioning at scaleConsistent hash, heartbeats, rebalance windows, and multi-worker simulation with ring ownership. · 20 min
  5. Part 5Production controlsLease renewal, fencing, graceful drain, and housekeeping for Postgres-backed durable work after order:9182 ships. · 18 min
  6. Part 6Choose the right durable-work shapeHow to choose inbox, outbox, projection, CDC, and saga patterns when implementing durable work in Postgres. · 15 min
  7. Part 7Cross-service handoffsTransactional outbox, transport choices, webhooks, contracts, and when brokers fit. Work that leaves your database commit. · 12 min
  8. Part 8Schema and operationsFull Postgres schema, inbox SQL, observability, testing, and schema evolution for order:9182. · 20 min
  9. Part 9Performance and scalingClaim-path tuning, indexes, and an interactive performance tuner for Postgres claim loops. · 15 min
  10. Part 10Build a small durable workflow engine in PostgresHow to extend a Postgres durable queue into a simple durable workflow engine with workflow definitions, step scheduling, timers, signals, and versioning. · 18 min
  11. Part 11How this fits with DDD, Event Sourcing, CQRS, and sagasHow Postgres durable work fits with DDD, domain events, transactional outbox, event sourcing, CQRS projections, sagas, CDC, and workflow engines. · 14 min

Topics

Writing

All posts

Build your own webhook transport

How to build a webhook registry and delivery system on Postgres using outbox rows, delivery attempts, signatures, retries, and inbound inbox rows.

16 min read

The claim loop

Minimal Postgres claim loop: enqueue, SKIP LOCKED claim, complete, and handler retry with an interactive simulation.

15 min read

Crash recovery

Leases, lease cleanup, at-least-once delivery, and handler idempotency for Postgres inbox workers.

12 min read

Many workers

Multi-worker contention, delivery guarantees, and per-key ordering before consistent hash.

15 min read

Partitioning at scale

Consistent hash, heartbeats, rebalance windows, and multi-worker simulation with ring ownership.

20 min read

Production controls

Lease renewal, fencing, graceful drain, and housekeeping for Postgres-backed durable work after order:9182 ships.

18 min read

Cross-service handoffs

Transactional outbox, transport choices, webhooks, contracts, and when brokers fit. Work that leaves your database commit.

12 min read

Schema and operations

Full Postgres schema, inbox SQL, observability, testing, and schema evolution for order:9182.

20 min read

Performance and scaling

Claim-path tuning, indexes, and an interactive performance tuner for Postgres claim loops.

15 min read