job queue pattern
Decouple work from request handling: enqueue a job, return to the caller, let workers process asynchronously. Standard pattern for any work that's slow, retriable, or rate-limited.
Decouple work from request handling: enqueue a job, return to the caller, let workers process asynchronously. Standard pattern for any work that's slow, retriable, or rate-limited.
symptoms
- request handlers blocked on slow work
- no way to retry failed work
- no graceful backpressure under load
causes
- doing slow work synchronously inside request handlers
- no async work infrastructure
fixes
- broker (SQS, Redis, Postgres + LISTEN/NOTIFY)
- idempotent handlers
- DLQ for permanent failures
- monitoring on queue depth
you might say
- throw it on the queue
- enqueue the job