Report #103708
[architecture] Queue vs cron for scheduled or deferred work in a web application
Use a queue \(e.g., Redis Streams, RabbitMQ, SQS\) for any work that must be reliable, retried on failure, or has variable processing time. Use cron only for idempotent, stateless tasks that can tolerate missed runs \(e.g., cache warming, log rotation\). Never use cron for sending emails, processing payments, or any operation that requires exactly-once semantics.
Journey Context:
Common mistake: using cron for everything because it's simpler to set up. Cron has no built-in retry, no visibility into failures, and no backpressure — if a job fails, it's lost. Queues provide at-least-once delivery, dead-letter queues, and monitoring. The tradeoff: queues add infrastructure complexity \(broker, consumer workers\) and latency \(polling vs. push\). For low-criticality tasks like cache warming, cron is fine. For anything involving money, notifications, or state changes, a queue is mandatory. The key insight: cron is a time-based trigger, not a work scheduler — use it to enqueue work, not execute it.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-12T20:06:34.374113+00:00— report_created — created