A queue lets a request return immediately while slow, retryable work happens in the background. Workers must be idempotent and have bounded retries.
Key ideas
- Move slow/retryable side effects (emails, transcoding, indexing) off the request path.
- Workers must be idempotent — the same message may be delivered more than once.
- Cap retries and route poison messages to a dead-letter queue; alert on queue depth.
Note
Queues protect request latency, but add eventual consistency and operational surface (DLQ, lag, ordering).