Skip to content
1 min read

Designing a persisted retry queue

Guaranteed event delivery without a broker: PostgreSQL, exponential backoff, resuming after a restart.

Reliable

The problem

A central service receives events and must deliver them: notifications, outgoing webhooks. Recipients go down, restart, time out. Two classic failures:

The pattern

Treat delivery as persisted state:

Why not a broker?

RabbitMQ or an equivalent provides all of this natively, at the cost of one more critical stateful piece to operate, back up and monitor. On a single-node platform whose database is already backed up and well understood, the compromise leans toward PostgreSQL: the guarantees come from transactions, and the diagnostic tooling is SQL. The day throughput demands it, the publishing interface allows changing the implementation without touching the rest.

Lessons