PHP MySQL second kill system How to determine the amount of inventory in real-time, when a large number of users snapping at the same time, how to determine inventory changes
Reply content:
PHP MySQL second kill system How to determine the amount of inventory in real-time, when a large number of users snapping at the same time, how to determine inventory changes
Could you put it in the cache, like memcache? Just a thought, I have not done this large-scale snapping, for reference only.
Atomic operations should all be possible, such as Redis string key, if it is MySQL, the row lock is also a choice.
Send a basic post http://www.csdn.net/article/2014-11-28/2822858
Control concurrency, a certain amount of time only released a certain quantity.
Millet snapping will not be a few seconds to put tens of thousands of of all out.
Normal judging with optimistic lock