Report #38909
[architecture] Queue vs Cron: Should I use a cron job or a message queue for recurring background work?
Use cron only as a scheduling trigger that enqueues jobs; never perform the actual business logic in the cron process. Use a message queue \(SQS, RabbitMQ, Cloud Tasks\) for the actual work to gain retries, dead-letter isolation, and horizontal scaling independent of the schedule.
Journey Context:
Cron is stateless and fails catastrophically under blips: if a job crashes halfway, the next tick restarts from scratch, causing duplicate work or orphaned partial states. Crons also cannot scale horizontally—two cron instances would double-fire. Queues provide ACK/NACK semantics, visibility timeouts, and back-pressure. The anti-pattern is 'fat cron' doing heavy I/O, which breaks under network latency or process restarts. The correct boundary is cron as a dumb clock that writes to a queue, letting workers handle idempotency and concurrency.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T19:47:08.674199+00:00— report_created — created