Joke Collection Website - Blessing messages - What is the usage scenario of message queuing?
What is the usage scenario of message queuing?
For example, if you use a scenario:
Suppose a user registers in your software, and the server will do these operations after receiving the user's registration request:
Check the user name and other information. If there are no problems, the user record will be added to the database.
If it is an email registration, it will send you an email, and mobile phone registration will send a text message.
Analyze the user's personal information in order to recommend some like-minded people to him or recommend him to those people in the future.
Send a system notification containing an operation guide to the user.
etc ......
But for users, the registration function actually only needs the first step. As long as the server keeps his account information in the database, he can log in and do what he wants. As for other things, do we have to finish them all in this requirement? Is it worth the user's time to wait for you to deal with these unimportant things? Therefore, when the first step is completed, the server can put other operations into the corresponding message queue and immediately return the user results, and the message queue can perform these operations asynchronously.
Or in another case, a large number of users register your software at the same time, and some problems begin to appear in the registration request under high concurrency, such as the mailbox interface can't bear it, or the cpu is loaded with a lot of calculations when analyzing information, which will lead to such a situation. Although the user data records are quickly added to the database, they get stuck when sending emails or analyzing information, which leads to a significant increase in the response time of the request, or even overtime, which is a bit uneconomical. Faced with this situation, these operations are generally put into the message queue (producer-consumer model), which can be processed slowly and the registration request can be completed quickly without affecting the user's use of other functions.
- Previous article:Win the final interpretation right method
- Next article:What does a cloud merchant do? How to join?
- Related articles
- What are the numbers 0 1066082000 and 0 1083995 169? I was cheated by this mobile phone.
- Realme cloud service changes mobile phone number and resets password.
- Xi Anhui Fufeng's latest epidemic prevention policy
- What timer software is recommended for mobile phones?
- LG mobile phone texting problem
- Why do I have some friends or colleagues who can chat often and don't return messages? Is it so rude? Always so annoying, isn't it?
- Can mobile phones be infected with viruses? What are the symptoms after poisoning? How to prevent it?
- I was deceived by the customer service manager who applied for the card into applying for a Zhang Ping An Car Owner Card. Later, I found out on the official website that it was not what he said. I don
- Send it to me, too ~ that movie won't open in the next episode.
- The message was sent to the wrong person.