About Message Queue
Message Queue three roles
Queuing server queue producer consumer queue
Message Queue Products
RabbitMQ: a message written in Erlang queuing products, enterprise-class message queuing software that supports load balancing messages, data persistence and so on. https://www.rabbitmq.com/
ZeroMQ: saltstack software uses this message, the fastest.
Redis: key-value system, supports queue data structure, lightweight message queue
Kafka: written by Scala, the goal is to provide a unified, real-time data processing for the high-throughput, low-latency platform
Action message queue
(1) program decoupling
It allows you to separate extension or modification process on both sides, just make sure that they comply with the same interface constraints.
(2) redundancy
Message Queue data for persistence until they have been fully processed, by this way to avoid the risk of data loss. Many message queue used by the "Insert - get - to delete" paradigm, before the message removed from the queue, you need treatment system clearly indicates that the message has been processed to ensure the preservation of your data is safe until you are finished using.
(3) peak capacity
Message Queuing enables access to critical components withstand burst pressure, but will not overload the request burst and collapse completely.
(4) recoverability
When a portion of the components of the system failure will not affect the entire system. Message queue reduces coupling between processes, so that even if a message processing process hang, queued messages can still be processed after the system recovery.
(5) the order assurance
Most originally ordered message queue, and can ensure that the data will be processed in a particular order. (Kafka order to ensure the message within a Partition)
(6) buffer
Help to control and optimize the speed of data flow through the system, to resolve conflicting news production and consumption of information processing speeds.
(7) asynchronous communication
In many cases, users do not want nor need to immediately process the message. Such as red envelopes, send text messages and other processes. It provides asynchronous message queue processing mechanism, allowing the user to put a message on the queue, but does not deal with it immediately. Think how many messages are placed in a queue to put much, then go to process them in time of need