Redis will publish subscribe model used as message queues, and the difference between rabbitmq

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 : with message consumer confirmation mechanism, if you publish a news, consumer spending has not been in the queue, then the message will remain stored in the queue until the consumer spending news article, this can ensure reliable consumer message;

real-time

Redis : real-time high, as Redis efficient cache server, all data is present in the server, 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 may be simultaneously subscribe multiple consumers, when a message arrives, in turn transmits the message to each subscriber;

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 : the queue, the message may be persistent selectivity, persistence smaller particle size, 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, real-time is not guaranteed;
RabbitMQ AMQP protocol is a special 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 timely and low reliability features.

Guess you like

Origin blog.51cto.com/13764714/2409276