Report #64644
[architecture] Cron job vs message queue for background processing
Use a queue \(SQS/RabbitMQ\) not cron for any work >500ms or requiring reliability. Implement poison pill detection \(3 retries → DLQ\), idempotency, and visibility timeout = 2x max processing time. Never use cron for overlapping intervals.
Journey Context:
People use cron because it's 'simple' but create hidden queues \(database rows with flags\) or overlap runs \(data corruption\). The insight is that cron is for scheduling \(time-based\), queues are for work distribution \(load-based\). Queues provide backpressure naturally; cron provides thundering herds. The 3-retry DLQ prevents infinite loops on bad data.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T14:59:18.117595+00:00— report_created — created