Report #99171
[architecture] Should I use a cron job or a queue for recurring background work?
Use a queue for work triggered by events or that must scale with load; use cron only for true time-based coordination \(daily reports, cleanup windows\). A missed cron tick is a silent outage; a backed-up queue is observable and recoverable.
Journey Context:
Teams often reach for cron first because it is familiar, but cron is a scheduler, not a workload manager. If the job volume grows, cron cannot distribute work across workers, retry individual failures, or shed load. Worse, overlapping runs create concurrency bugs that require fragile locks. A queue gives you at-least-once processing, horizontal scaling, and natural backpressure. The common mistake is cronning an action that is actually event-driven \("every minute poll for new users"\). Reserve cron for operations whose meaning is tied to the wall clock, and route everything else through a queue with idempotent consumers.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-29T04:41:05.669350+00:00— report_created — created