pg-queue
pg-queue
Postgres-native job queue, pub/sub, and cache.
I was already running Postgres and did not want to add Redis just for background jobs. So I used what Postgres already does.
How it works
| Feature | Mechanism | Replaces |
|---|---|---|
| Job queue | SELECT ... FOR UPDATE SKIP LOCKED | Redis lists, Celery, Sidekiq |
| Pub/sub | LISTEN / NOTIFY | Redis pub/sub, NATS |
| Cache | UNLOGGED table with TTL per row | Redis GET/SET/EXPIRE |
| Request-response | Queue + NOTIFY with correlation ID | Redis streams, RPC frameworks |
Why it works
SKIP LOCKEDlets multiple workers grab jobs at the same time without blocking each otherLISTEN/NOTIFYpushes events to subscribers the instant a row is inserted: no pollingUNLOGGEDtables skip write-ahead logging for cache-tier speed (data is not crash-safe, which is fine for a cache)- Zero new infrastructure. Your Postgres already does all of this
Where it is used
Primary consumer: Testudo. The transactional outbox bridge between the execution engine and the DLT settlement layer.