redis rabbitmq do with the difference between the message queue

Message Queue (Message Queue) is a communication between an application, the message can be returned immediately by the message system to ensure reliable delivery of the message. Post Owner shoved the messages posted to the MQ without tubes who will take the message users simply take a message from the MQ regardless of who posted. Such publishers and users do not know about each other.
 
repeat
     In my learning process, redis is an in-memory database with rich data types, of course, support queue queue, redis support data persistence, from the main cluster. Redis only supports simple key-value data types, while also providing a storage list, set, zset, hash and other data structures.
 
RabbitMQ
    Is a framework designed to do the queue, the queue performance is better than redies in the queue, support functions will be more and stronger reliability of the message, you can choose which one to go into the queue according to the routing rules, so that a more detailed message distribution
 
reliability
redis: there is no mechanism to ensure reliable consumer information, if the publisher released a message without words corresponding to the subscriber, the message will be lost and will not exist in memory;
rabbitmq: the consumer has a message confirmation mechanism, if an announcement has not been consumer spending that queue, so that the message will have been stored in the queue until the consumer spending news article, this can ensure reliable consumer information then rabbitmq news is how to store it? (Subsequent updates);
 
real-time
redis: real-time high, as Redis efficient cache server, all data stored in memory, so it has a higher real-time
 
Consumer Load Balancing:
rabbitmq queue can be multiple consumers simultaneously monitor consumption, but each message can only be consumed once, due to the consumption of rabbitmq confirmation mechanism, so that it can adjust its load according to the consumer's ability;
redis publish subscription model, a queue can be simultaneously subscribe to multiple consumers, when a message arrives, it will in turn send the message to each subscriber, she is a form of broadcast message, it is not to consumers redis load balancing, and therefore there is a bottleneck consumption efficiency;
 
Endurance
redis: redis persistence is directed to the entire contents of the cache redis, it has two kinds of AOF RDB and persistent manner (redis persistent way, subsequent updates), the entire redis instance persisted to disk in order to do data backup to prevent data loss resulting in exceptional circumstances.
rabbitmq: queues, each message may be selectively persistent, lasting particle size smaller and more flexible;
 
Queue monitoring
rabbitmq realized the background monitoring platform, you can see details of all queues created good background management platform aspects of our better use on the platform;
redis no so-called monitoring platform.
 
to sum up
redis: lightweight, low-latency, high concurrency, low reliability;
rabbitmq: heavyweight, highly reliable, asynchronous, does not guarantee real-time;

rabbitmq is a specialized protocol AMQP queue, his advantage is to provide reliable service queue, and can be done asynchronously, and redis primarily for caching, redis publish-subscribe module can be used to achieve timeliness and reliability low functionality.

More technical information may concern: gzitcast

Guess you like

Origin www.cnblogs.com/heimaguangzhou/p/11497484.html