Report #104393
[architecture] Should I use a cron job or a queue for periodic tasks?
Use cron for predictable, time‑based schedules \(e.g., daily report at 3 AM\). Use a queue \(e.g., Redis, SQS, RabbitMQ\) for event‑driven tasks \(e.g., send email after signup\). If you need both, consider a scheduler that combines cron triggers with queue processing \(e.g., Celery Beat, AWS EventBridge\). Cron lacks built‑in retries, concurrency control, and visibility; queues provide at‑least‑once delivery, retries, dead‑letter queues, and scaling.
Journey Context:
A common mistake is using cron for tasks that may overlap or need automatic retries. Cron jobs run on a schedule without awareness of previous executions, leading to duplicates or missed retries. Queues are designed for asynchronous work distribution but require a worker process. For mixed workloads, a scheduler \(like Celery Beat\) lets you define a cron schedule and push jobs to a queue, combining reliability of queues with the simplicity of cron syntax.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-08-16T20:02:45.316573+00:00— report_created — created