Report #104519
[architecture] Should I use a queue or a cron job for scheduled tasks?
Use a queue \(e.g., Amazon SQS, RabbitMQ\) for tasks that require guaranteed execution, retries, and idempotency; use cron only for tasks that can tolerate missed runs and do not need durability or concurrency control.
Journey Context:
Cron jobs are stateless, have no built-in retry mechanism, and can cause thundering herd if many tasks fire simultaneously. Queues provide persistence, visibility timeouts, dead-letter queues, and consumer scaling. The common mistake is using cron for critical business logic \(e.g., sending invoices\) where a missed run is unacceptable. A queue adds complexity \(consumer management, visibility timeout tuning\) but is essential for reliability. Alternatives include using a database-backed locking mechanism with cron, but that still lacks durability guarantees.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-08-30T20:10:18.646872+00:00— report_created — created