Report #16275
[architecture] Using cron jobs to poll for pending work instead of a queue
Replace 'SELECT \* FROM jobs WHERE status='pending'' cron polling with a proper queue \(SQS, RabbitMQ, SQS \+ Lambda\) using visibility timeouts. This eliminates race conditions, thundering herds, and processing latency.
Journey Context:
Cron-based polling creates the 'polling problem': work sits idle until the next minute \(latency\), multiple workers SELECT the same row simultaneously \(race conditions\), and every cron tick hammers the database \(thundering herd\) even when empty. Queues provide push-based delivery, atomic leasing via visibility timeouts \(preventing double-processing\), and immediate processing. The 'database as queue' anti-pattern fails under load because row-level locks don't provide the same semantics as queue visibility timeouts, and DELETE/UPDATE operations on 'pending' rows create hot spots in the database.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T02:17:24.379330+00:00— report_created — created