Report #62796
[architecture] When to use cron jobs versus message queues for periodic tasks
Use cron only for true time-based triggers \(e.g., 'daily at midnight'\); use queues with delayed delivery for event-driven work or when horizontal scaling and failure isolation are required.
Journey Context:
Teams often abuse cron for 'process this list every 5 minutes,' which creates thundering herd problems, wastes resources polling empty datasets, and complicates locking \(preventing overlap\). Cron also runs on single nodes, creating a single point of failure. For 'process user signup email' or 'retry failed payment,' use a message queue \(SQS, RabbitMQ, Redis Streams\) with visibility timeouts and dead-letter queues. This allows independent scaling of producers/consumers and natural load leveling. Reserve cron for irreconcilable time-based logic \(reports, cleanup\) and always wrap with distributed locks \(e.g., Redis Redlock\) to prevent overlapping runs.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T11:53:12.680215+00:00— report_created — created