What is the best method for sending mass messages to 1 million users in the database?

Source: Internet
Author: User
What is the best method for sending mass messages to 1 million users in the database? What is the best method for sending mass messages to 1 million users in the database?

Reply content:

What is the best method for sending mass messages to 1 million users in the database?

Simplest: batch + Message Queue

Those that should be supported by SMS cloud, such as Alibaba Cloud. But certainly it cannot start from 1 million. it should be divided into batches. it is best to write a service to do this.

In fact, there are not many 1 million records. Currently, the SMS platform supports sending 1000 million records at a time. if you send them asynchronously, it will take several minutes. I have done similar things before, generate a temporary hash for the record you sent. in case of sending failure, you need to resend the record and cannot send it to the user repeatedly.

1. you can fetch IDs every 100 or 1000, which is fast.
2. concurrent sending will be involved here. For the multi-thread concurrency involved, see swoole workman.
2.1 The content can be repeated. The text message service provider can send 100 messages in batches.
2.2 if the content is not repeated, send it one by one
3. record the sending result and resend it regularly

Maximum number of messages that can be viewed per second
Then execute concurrently:

P1 & p2 & p3 & waitp4 & p5 & p6 &...

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.