What is a job queue and why does your application need one?
Published on 2026-10-20 by frfrand
What is a job queue, how workers consume it, and how to handle retries, idempotency, and failed jobs without duplicating charges or emails.

Short answer: a job queue stores pending tasks so that one or more processes, the workers, can execute them without forcing the user to wait while they run. The hard part is not enqueuing, but deciding what happens when a task fails or runs twice: that's why retries with a limit and idempotency matter.
It's the piece usually behind emails, reports, videos, imports, and automations.
Imagine someone clicks "Generate monthly report" and the application takes three minutes to finish. Keeping the browser waiting all that time would be uncomfortable and fragile. A queue offers a better way to organize that work.
The kitchen comparison
In a restaurant, orders arrive, are written down, and then the cooks prepare them. The waiter doesn't stay by the oven waiting for each dish: they can keep attending to other tables.
In an application, a web server can register a job in a queue and respond immediately: "We received your request." Then a worker takes the task, processes it, and records whether it finished, failed, or needs a new attempt.
The queue separates the moment of requesting something from the moment it is actually completed.
How is a queue-based system organized?
Usually there are three parts:
Producer: the application that creates the task. For example, an API that receives the request to generate a PDF.
Queue or broker: the mechanism that keeps jobs available for their consumers, according to their delivery and persistence rules.
Consumer or worker: the process that takes jobs and executes the operations.
A result can also be saved in a database so the user can check progress. Not all queues include result storage or tracking interfaces.
Real example: sending a thousand emails
Suppose a store needs to notify a thousand customers about a change in hours. It would not make sense for whoever clicked "Send" to be stuck with the page blocked until the last email.
The application can create sending jobs and process them with workers. This also makes it possible to limit how many messages go out simultaneously and how to react when the email provider returns a temporary error.
But there is a detail: the fact that a task is queued does not guarantee that the email reaches the recipient. You have to distinguish between job accepted, sending attempted, and delivery confirmed.
What happens when a worker fails?
A task can fail because a connection dropped, a file does not exist, or an external service is offline.
Some systems allow retrying the job, waiting an interval, or sending it to a dead-letter queue. It is not advisable to retry infinitely without control: you could repeat an operation that always fails and consume all resources.
Additionally, a worker can complete an action but fail before recording that it finished. If the system re-executes that task, you could repeat a charge or send a notification twice.
The importance of idempotency
An idempotent operation is designed so that repeating it does not cause additional unwanted effects relative to its final result. For tasks such as "confirm this payment" or "register this reservation," it is essential to avoid duplications.
You can use unique identifiers and records of processed operations. It is also advisable to design the database to prevent inconsistent states, rather than relying solely on queue behavior.
A system promising "at least once" delivery precisely implies that repeated executions may exist. That guarantee is not the same as exactly-once execution of the entire business logic.
Is Redis suitable as a queue?
Redis can be part of messaging and queue architectures; tools like Celery and other systems can use appropriate brokers according to their configuration.
But a cache and a queue are not the same, even though they sometimes use the same software. A cache entry can be lost with no further consequences than repeating a query; a lost billing task can be much more serious.
When tasks are important, review durability, acknowledgments, retries, monitoring, and recovery.
When you don't need a queue?
If an operation takes a few milliseconds, completes within the request, and has no special requirements, adding multiple workers and a broker can be unnecessary complexity.
Before adding another piece of infrastructure, measure how long the job takes, what happens when it fails, and how many tasks arrive at the same time.
What does this have to do with ArduMaker?
In ArduMaker, Redis and n8n are installed as apps on a VPS from the catalog. If your backend is deployed from GitHub, workers are declared as processes in the deploy configuration (a process that does not publish HTTP) and periodic tasks as systemd timers: the platform writes and restarts those units on every deploy. But it does not define the retry policy nor prevent duplicates: that logic belongs to the project.
In one sentence: a queue allows deferring and distributing jobs. The hard part is not putting tasks on hold, but knowing what to do when they repeat, fail, or disappear.
Frequently asked questions
What is a dead letter queue? It is a separate queue (in English, dead letter queue) where tasks that exhausted their retries go. It serves to review them manually without blocking the rest nor losing them.
How many times is it worth retrying? Few times and with increasing waits between attempts. A temporary error, such as a provider being down, usually resolves with two or three retries; a permanent one, such as invalid data, is not fixed by retrying.
Does a queue guarantee that each task runs exactly once? No. Most promise «at-least-once» delivery, so a task can repeat. That's why important operations must be idempotent.
Sources: Celery Guide · Redis Streams Documentation What is a worker.
