How does the mall flash sales work?

Source: Internet
Author: User
All right. thank you! How does the mall flash sales work?

All right. thank you!

Reply content:

All right. thank you!


Optimistic queue lock pessimistic lock


Set the maximum number of seckilling tasks. All requests that exceed the limit are blocked.
The specific quantity of the second kill limit, which requires stress testing.
The IP address of the malicious request, which is directly blocked.


Ajax sends a request to the backend, and the backend uses the queue to request the database.

At the same time, ajax always requests the backend at the front end, and the backend returns a second kill success or failure.


You can use the redis queue to lock the inventory and generate orders. for example, if there are 100 inventories, you can calculate whether the queue length is greater than 100 every time you add them to the shopping cart.

How is the second kill in the mall achieved? For more information, see The PHP Chinese website (www.php1.cn )!

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.