某草草2017-05-16 13:04:46
Can be achieved through database lock
Open business
select * for update
update inventory
Submit transaction
習慣沉默2017-05-16 13:04:46
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)
迷茫2017-05-16 13:04:46
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