Menu

Saved to Postgres, never queued: the transactional outbox for Node
📰

Saved to Postgres, never queued: the transactional outbox for Node

DEV Community: backend·Krrish Kumar·10 days ago
#J4SIp2Bb
#devtobackend#devto#dev#outbox#await
Reading 0:00
15s threshold

Here's a bug that never shows up in tests. A request saves an order to Postgres, then calls queue.add('send-receipt', ...) . The deploy restarts the pod between those two lines, or Redis blips for two seconds, and now you have a paid order that never gets a receipt, an invoice or a warehouse pick. Nothing errors. Nothing retries. The two writes were never one unit, and nobody notices until a customer emails.

I'm Krrish Kumar, a backend engineer. I wrote this with AI assistance for drafting and editing; the code and every number below come from a test script I ran against PostgreSQL 18.6 and Redis, with BullMQ 5.81.5 and 6.5.3.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.