Report #49415
[architecture] Deciding between time-based triggers and event-driven background processing
Use a queue \(worker\) for event-driven, high-volume, or latency-sensitive background jobs; use cron only for truly time-based schedules \(daily reports, cleanup\) and never for 'polling' patterns—if you find yourself checking 'if it's time to do X' in a loop, use a queue with a scheduled delivery time \(e.g., BullMQ, SQS delayed messages, RabbitMQ TTL\).
Journey Context:
Teams abuse cron jobs to poll for work \(e.g., 'every minute, check if there are emails to send'\), which creates race conditions, wastes resources polling empty queues, and has poor latency \(average delay is half the interval\). A queue provides immediate processing \(push vs pull\) and natural load balancing. Cron is only correct when the trigger is truly temporal \(e.g., 'generate a daily summary at midnight'\). For 'do this later' \(delayed jobs\), use a queue that supports scheduled messages \(e.g., AWS SQS with DelaySeconds, RabbitMQ dead-letter exchanges with TTL, or BullMQ in Node.js\), not a cron job that sleeps. Cron also has 'thundering herd' problems when multiple instances run the same job simultaneously—queues handle concurrency naturally with a single consumer pool.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T13:25:29.309187+00:00— report_created — created