Architecture Design for sending tens of millions of text messages and SMS architecture design

Source: Internet
Author: User

Architecture Design for sending tens of millions of text messages and SMS architecture design

The client will charge information (the number of deductions, fees .....) Submit to the billing subsystem. The billing subsystem receives a request and caches the data to the local Cache (memory or other caches). The local Cache data structure is Key-Quue, and the key is the user ID, queue is used to store user billing information), and notifies the task allocation service to allocate a thread to process the deduction information (only once, this thread will come out of this user later ),One processing thread can process multiple users,However, a user cannot be allocated to multiple process deduction threads.Return a response immediately after the notification is completed. (Because only one allocation is performed, the first time and a few millimeters later, the response time is almost 0 ).

After the processing and deduction service is started, it obtains the queue instance referenced by this user Key from the local cache based on its own processing user Key, you can directly read the user's billing information from the instance for fee deduction. In order to speed up the process, you can read it in batch from the queue and deduct the total amount from the database at one time. After the deduction is complete, update the local balance cache.

 

Interface Design: 1. Provides a billing Interface

2. provides an interface for obtaining balances

Protocol type: Socket is recommended for communication protocols.

Customer verification balance: directly obtain the balance in the memory to avoid overhead on the database.

Distributed cluster: The local cache and task allocation services are designed to be shared, and can be distributed and cluster.

Queue: We recommend that you use a Queue that implements the "No wait (wait-free)" algorithm.

Processing fee deduction service: the number of users to be processed is configurable. When the amount of user fee deduction information is very large, it can be set to one thread and one user. When the number of users is small, one thread can process multiple users, to save resources. (You can also write a simple algorithm to determine the amount of information currently charged by users)

See the architecture sketch below

Related Article

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.