Node.js reminder queues: idempotent retries for at-least-once message delivery
Duplicate user reminders usually mean the queue redelivered a message, so the design should assume at-least-once delivery from the start. The recommended approach is to persist a durable reminder send key before calling the email or SMS provider, then acknowledge the message only once that state is safe. A unique database constraint makes replays harmless, turning a duplicate into a no-op. The article compares Amazon SQS, Google Cloud Pub/Sub, BullMQ with Redis, and a managed REST queue, favoring a managed queue with a simple worker and an idempotency table for small Node.js products. It also warns that no queue setting can make a database write and a provider call atomic, so provider-side idempotency or reconciliation is still needed.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in