Node.js retry design: queues, dead-letter handling, and cron's narrow role
Short answer: for failed Node.js SaaS background jobs, use a queue with worker-driven retries and a dead-letter queue; use cron to start periodic cleanup or redrive work, not to represent each failed job. Option Use it for What changes the decision Queue plus DLQ Per-job retries and isolation The consumer must be idempotent because standard delivery is at-least-once. Cron Periodic cleanup or a…
When dealing with failed Node.js SaaS background jobs, it is recommended to use a queue with worker-driven retries and a dead-letter queue (DLQ). The consumer must be idempotent, as standard delivery is at-least-once. Cron should be used for periodic cleanup or a DLQ review, not for representing each failed job. BullMQ is a Node.js deployment already built around Redis and can be a reasonable fit when that runtime is already an intentional dependency.
RabbitMQ and Amazon SQS are alternatives that offer broker-level control and a dead-letter queue model, respectively, which can also fit the same retry pattern. The recommendation is to use a queue as the default, with a failure belonging to one job, one acknowledgement decision, and one route to later inspection. A schedule only indicates when to run something, while a queue provides a unit of work with a delivery lifecycle.
Brief written by urgent.news from Dev.to's own syndicated text. Machine-written — may contain errors; check the original before relying on it.