Skip to content
Web Design & Development

How to Get Background Jobs and Queues Right

Moving slow work, such as sending emails, processing images or calling external APIs, out of the web request into background jobs processed by workers.

MediaScaleUp Editorial Team 2 min read 12 views
How to Get Background Jobs and Queues Right

Why does it matter?

Doing slow work during a request makes pages slow and fragile, while queues keep responses fast and let failed tasks be retried.

What are the numbers?

  • Queue drivers such as database, Redis or cloud queue services
  • Workers long-running processes that take jobs from the queue
  • Retries failed jobs can be retried with delays
  • Failed jobs should be stored for inspection

What should I do?

  1. Queue email, media processing and third-party API calls
  2. Make jobs idempotent so retries are safe
  3. Monitor queue length and failed jobs
  4. Restart workers after deployments
  5. Set timeouts and retry limits
What to do and what to avoid with background jobs and queues, side by side
Good practice against the usual mistakes, from the sources listed below.

What should I avoid?

Avoid:

  • Slow API calls inside page requests
  • Jobs that fail silently
  • Workers running old code after deploys
  • Unlimited retries that hammer external services

When should I get help?

Short answer Bring in help when pages are slow because of work done during requests, or when background jobs fail unnoticed.

Where this comes from

The figures and practices above come from the sources listed.

Working on something like this?

We take on Web Design & Development work for teams who want it done once, properly. Tell us what you are building and we will tell you honestly whether we are the right studio for it. Start a project.

Where to go next

Spotted something wrong? Report an error on this page. We correct on the page and say what changed.

All services

The work behind this article, and what it costs.

MediaScaleUp Editorial Team

Articles here are researched, written and checked by the MediaScaleUp studio team before they are published, and dated when they are reviewed.

Keep reading

More in Web Design & Development