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.