Report #21257
[architecture] When to use a job queue instead of cron for scheduled tasks
Replace cron with a persistent job queue \(Redis/Bull, SQS, RabbitMQ\) when tasks require: distributed locking \(prevent overlapping runs\), dynamic scheduling \(per-user schedules\), guaranteed delivery \(at-least-once\), or visibility into failure/retry state; reserve cron only for simple, idempotent, node-local tasks \(log rotation, temp cleanup\).
Journey Context:
Cron failure modes: overlapping runs \(duplicate processing\), silent failures \(no retry\), no horizontal scaling \(tied to single node\), drift in clusters \(clock skew\). Common mistake: using distributed cron \(Kubernetes CronJob\) for business-critical workflows without idempotency guards. Queues provide: ACK/NACK semantics, dead-letter queues for poison pills, exponential backoff, concurrency limits. Tradeoff: operational complexity \(Redis Sentinel vs single cron line\). Hybrid: cron enqueues jobs to queue rather than executing directly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T14:05:38.319177+00:00— report_created — created