Redis can also implement queues. Why do we need rabitmq or kafka?

Source: Internet
Author: User
As the question. How is your queue used? I use it like this. It is a production task, and then the crontab is run in the background to regularly run the content in the queue. This is what the interviewer asked me during the interview. He told me that you are not using this method, but that is not true for the queue. He said that you should use crontab to run the queue, which sum is used... as the question. How is your queue used?
I use it like this. It is a production task, and then the crontab is run in the background to regularly run the content in the queue. This is what the interviewer asked me during the interview. He told me that you are not using this method, but that is not true for the queue. He said that you should use crontab to run the queue, which is no different from using a database as a queue. But I did, and I was not very interested in asking him why he was right .... How do you use it?

Reply content:

As the question. How is your queue used?
I use it like this. It is a production task, and then the crontab is run in the background to regularly run the content in the queue. This is what the interviewer asked me during the interview. He told me that you are not using this method, but that is not true for the queue. He said that you should use crontab to run the queue, which is no different from using a database as a queue. But I did, and I was not very interested in asking him why he was right .... How do you use it?

Key-value can also be achieved by writing files directly. Why redis?

The choice of these components is rogue. The load is not large, and the reliability requirement is not high. It is the same if there is no need for expansion. As mentioned earlier, you can write files without redis, write a file to a folder => join, take out and delete => quit

As for ack, distributed, and stress-resistant, there are basically no ready-made solutions for redis, some of which can be solved by themselves, and some cannot be solved, so there will be a variety of professional queue components, some focus on speed, some focus on distribution, and some focus on reliability, they will try to solve some problems that redis cannot solve. It's like if you write files on a disk when key-value is used, the IO speed naturally becomes a bottleneck, and the load capacity is not good, so there will be professional redis for memory kv

I know that one method is to use a blocking queue to wait and a message will pop up.

I use a Message Queue implemented by socket. io.

The queue is implemented in redis memory. Persistence is not a strong point. Dedicated MQ is more reliable. Redis's cache function is its specialty. It is more suitable than good or bad.

Redis implements simple queues without persistence. Server Load balancer does not (a KEY cannot be placed on multiple servers ). Dedicated MQ products in this area are still better.

Specialized in the industry

Publishing/subscription Mode
The subscriber only needs to register himself. When a message arrives, the subscriber will receive a notification, so no polling is required.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.