Situation: A company can have many servers: weaker and more powerful, older and newer, already loaded with work and practically free. For example:
- There are servers in your server park that often fail, for example, due to old age.
- Even if everything is in order with the servers, they still sometimes fail. Because of this, there is a risk of losing a critical request, for example, about a significant transaction.
- You have a development department with testers. For testing, they use server capacity, which they request blindly. As a result, individual servers during testing periods are overloaded.
What happens without queues: Requests go to any accessible server, regardless of its workload and ability to complete the task. In the case of an uneven distribution of submissions, some servers may be idle, and some may work on their last legs and solve problems much more slowly than allowed.
Or some server may crash or go into reboot. If a request goes to it simultaneously, it will be lost.
How Queues Can Help
Requests can not be sent directly to servers but put in a queue. And the server, when it is freed from the previous task, will itself “come” to the line and pick up a new request from there. As a result, the weaker server will access the queue less often and work at a comfortable pace. And more powerful – faster to cope with tasks and take on new requests more often.
A disconnected or broken server will not receive the task at all – it simply will not be able to access the queue until it starts working again. As a result, not a single request will be lost.
Handling Important But Not Urgent Tasks In The Background
Situation: There can be many additional tasks in the operation of an IT system:
- Sending email, processing images
- Generating reports
- Converting files to other formats
All these tasks do not require instant execution, and the user is willing to wait if they notify him that the request has been accepted and everything is in order.
- You have a website that you regularly update: upload new products, adjust prices, collect and publish reviews from users. All these tasks are not urgent, but sometimes there are a lot of them. At the same time, the site must continue to accept orders, usually when they are completed.
- On Friday during the day, employees send requests to generate reports. There are a lot of applications, but words will be needed only by Monday – you can not do them urgently.
What happens without queues: Non-urgent tasks go to execution on the server immediately. And as a result, they can interfere with doing something meaningful and urgent, for example, to work out a client’s request.
How queues can help: All background requests do not go to the server immediately but are queued. When the server is released from the load, he takes what he can do from the queue.