Report #48609
[architecture] How to handle scheduled background jobs in a horizontally scaled system
Use a queue with lease-based consumption \(visibility timeout\) instead of cron; schedule enqueueing via cron, but execution via distributed workers
Journey Context:
Cron jobs run on specific nodes, creating single points of failure and clock skew issues in distributed systems. If the cron node dies, schedules are missed. Queues allow any worker to pick up tasks, enabling horizontal scaling and automatic failover. The cron should only enqueue jobs into the queue; workers pull and acknowledge completion via leases to handle crashes mid-task.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T12:04:13.618365+00:00— report_created — created