Backend and APIs · Pattern

Queues and background jobs

A way to hand slow work, such as sending emails or processing videos, to a separate worker so the app can answer the user straight away.

Jobs and glue · updated

How it works

Instead of doing everything inside the request, the app adds a job to a queue ('send the receipt for order 42') and responds at once. Worker processes take jobs off the queue and run them, retrying with growing delays when something fails and moving jobs that keep failing to a dead-letter queue for someone to inspect.

Common tools include BullMQ (Node.js on Redis), Celery (Python), Laravel's queues, Amazon SQS, RabbitMQ and Cloudflare Queues, plus HTTP-based services such as QStash, Inngest and Trigger.dev that suit serverless apps. Most deliver each job at least once, so a job can occasionally run twice and its handler should be idempotent.

More in Backend and APIs

Jobs and glue

All 26 Backend and APIs terms

Crafted in the dark. Shipped to the world.

Tell us what you are building. You get a private project space with a proposal and a line-by-line quote within a day.