php - How to solve if there are 10 items in inventory but 100 people buy them
ringa_lee
ringa_lee 2017-05-16 13:02:46
0
4
422

Please describe it in detail, thank you

ringa_lee
ringa_lee

ringa_lee

reply all(4)
某草草

Can be achieved through database lock

  1. Open business

  2. select * for update

  3. update inventory

  4. Submit transaction

迷茫

http://www.cnblogs.com/viaiu/...

習慣沉默

Use a queue to execute, limited to 10, and push into the stack according to time. Set the expiration time, and if the order is not completed within the limited time, it will be removed from the stack. Re-retrieve the missing number of people from subsequent users. Those who complete the order are placed in another queue for later synchronization of the database. (This is just a general idea)

迷茫

You yourself are too lazy to describe the problem clearly, but you want the respondent to describe the problem more specifically? All I can tell you is that the remaining 90 people can’t buy it

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template