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