Report #9095
[architecture] Should I use cron or a job queue for scheduled background work?
Use cron with a distributed lock only for simple, idempotent, single-instance tasks; use a delayed job queue \(e.g., SQS, Bull, Celery\) for anything requiring reliability, retry logic, or horizontal scaling.
Journey Context:
Cron suffers from the 'leader election' problem in distributed environments—without a distributed lock \(Redis/DB\), multiple instances run the job simultaneously. Cron also has no built-in retry on failure and cannot handle backpressure. Queues provide at-least-once delivery, exponential backoff, dead-letter queues for poison pills, and scale horizontally by adding workers. However, queues add operational complexity \(monitoring queue depth, handling duplicates\). Cron is acceptable only for internal tools or single-node deployments where a missed run is acceptable.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T07:16:37.520805+00:00— report_created — created