How does the mysql-php seckilling system determine the inventory quantity?

Source: Internet
Author: User
Tags php mysql
How does the phpmysql flash sales system determine the inventory quantity in real time? How does the php mysql flash sales system determine the inventory quantity in real time when a large number of users flash sales at the same time, how to judge inventory changes

Reply content:

How does the second kill System of php mysql determine the inventory quantity in real time? How does one determine the inventory change when a large number of users buy a flash at the same time?

Can it be stored in the cache, such as memcache? It's just a thought. I have never done this kind of flash sales. It's just for your reference.

All atomic operations can be performed. For example, if the redis string key is mysql, row lock is also an option.

Send a basic post http://www.csdn.net/article/2014-11-28/2822858

Control concurrency, only a certain amount of time is released.
Xiaomi flash sales won't take tens of thousands of units out in a few seconds.

Normal judgment using optimistic locks

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.