Reprinted from: Http://www.oschina.net/translate/top-10-uses-for-message-queue
The original: Top Uses for A Message Queue
Oschina recommended 3 years ago (total 7 paragraphs, translation completed 08-21)
Participation in Translation (4 people): Lwei, Garfielt, Holiday_, wang7x
We've been using, building, and propagating message queues over the last few years, and we think they're awesome, and that's not a secret. We believe that Message Queuing is a critical component for any architecture or application, and here are 10 reasons:
1. Decoupling
It is extremely difficult to anticipate what needs to be encountered in future projects at the start of the project. Message Queuing Inserts an implicit, data-based interface layer in the middle of processing, which is implemented on both sides of the process. This allows you to independently extend or modify the processing on both sides, as long as you ensure that they adhere to the same interface constraints.
2. Redundancy
Sometimes the process fails when processing data. Unless the data is persisted, it will be lost forever. Message Queuing persists the data until it has been fully processed, bypassing the risk of data loss in this way. In the insert-get-delete paradigm used by many message queues, before removing a message from the queue, it is necessary that your process explicitly indicate that the message has been processed and that your data is safely saved until you have finished using it.
3. Extensibility
Because Message Queuing decouples your processing, it is easy to increase the number of messages queued and processed, as long as additional processing is required. No need to change the code, do not need to adjust parameters. Expansion is as simple as adjusting the power button.
4. Flexibility & Peak handling capability
When your app is on the home page of Hacker News, you'll find that access traffic climbs to an unusual level. Your app still needs to continue to function in the event of a surge in traffic, but such bursts are not common, and it is a huge waste to be ready to invest in resources that can handle this type of peak access. Using Message Queuing enables critical components to withstand increased access pressure, rather than crashing completely because of requests that exceed the load. Check out our blog post on peak handling capabilities for more information on this.
5. recoverability
When a part of the system fails, it does not affect the entire system. Message Queuing reduces the degree of coupling between processes, so even if a process that processes messages is hung up, messages queued to the queue can still be processed after the system resumes. This ability to allow retries or delays in processing requests is often the difference between a slightly inconvenienced user and a frustrated user.
6. Delivery Guarantee
The redundancy mechanism provided by Message Queuing guarantees that the message can be actually processed, as long as a process reads the queue. On this basis, IRONMQ provides a "one-time-only" guarantee. No matter how many processes are picking up data from a queue, each message can be processed only once. This is possible because getting a message just "booked" the message and temporarily moved it out of the queue. Unless the client explicitly indicates that the message has been processed, the message is put back in the queue and can be processed again after a configurable amount of time.
7. Ordering Guarantee
In many cases, the order of data processing is important. Message Queuing is inherently sorted and ensures that data is handled in a specific order. IRONMO guarantees that message pastes are processed in the Order of FIFO (first-in, in-place), so that the message is positioned in the queue to retrieve their location from the queue.
8. Buffering
In any important system, there will be elements that require different processing times. For example, loading a picture takes less time than applying a filter. Message Queuing helps perform the most efficient execution of a task through a buffer layer-the processing of the write queue is as fast as possible, rather than being constrained by the pre-processing that is read from the queue. This buffering helps to control and optimize the speed of the data flow through the system.
9. Understanding Data Flow
In a distributed system, it is a huge challenge to get a general impression of how long and why user actions will take. The message series is easily aided by the frequency of messages being processed to identify poorly performing processes or areas where data flows are not optimized.
10. Asynchronous communication
Many times, you don't want or need to process messages immediately. Message Queuing provides an asynchronous processing mechanism that allows you to put a message in a queue, but not immediately handle it. How many messages you want to put into the queue, and then deal with them when you're happy.
We believe that the 10 reasons above make Message Queuing the best form of communication between processes or applications. We've spent a year creating and learning Ironmq, and our customers have done a lot of incredible things through Message Queuing. Queues are the key to creating powerful distributed applications that take advantage of all the power that cloud technology offers.
If you want to start using an efficient, reliable, managed message queue now, download Ironmq. If you would like to contact one of our engineers and ask how to integrate the queues into your application, they are always welcome to visit: Get.iron.io/chat.
Message Queuing "Go"