Report #95907
[architecture] Should I use a job queue or a cron scheduler for background work?
Use a queue \(e.g., SQS, RabbitMQ, Sidekiq\) for work triggered by user actions or requiring immediate retry; use cron only for true time-based recurrence \(e.g., nightly reports\) with no external trigger.
Journey Context:
Teams often default to cron for everything because it's familiar, leading to 'polling' architectures that waste resources and create race conditions when multiple workers pick up the same job. Queues provide natural load leveling, visibility into backlog depth, and dead-letter handling for failed jobs. Cron is correct only when the schedule itself is the source of truth \(e.g., 'run every day at 2 AM'\), not when reacting to events. Hybrid approaches \(queue for real-time, cron for batch\) are common in mature systems.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T19:33:41.162171+00:00— report_created — created