How does one handle the remaining 138 concurrent operations of the current product? for example, if 100 people simultaneously end the remaining number of times at the same time, isn't the number overflow? How do I create a data table and control concurrent operations? if the number of times required for a product is full, how can I enable it automatically...
How does one handle the remaining 138 concurrent operations of the current product? for example, if 100 people simultaneously end the remaining number of times at the same time, isn't the number overflow? Generally, how does one create a data table and control concurrent operations? if the number of times required for a product is full, how does one automatically start a new phase?
I have never had a good idea.
Reply content:
How does one handle the remaining 138 concurrent operations of the current product? for example, if 100 people simultaneously end the remaining number of times at the same time, isn't the number overflow? Generally, how does one create a data table and control concurrent operations? if the number of times required for a product is full, how does one automatically start a new phase?
I have never had a good idea.
I told you that there is no need to strictly lock this thing in terms of business. for example, what if 5000 people win the treasure and 6000 people send money?
Do you know the number of participants? I don't know. you don't know either. only NetEase knows.
The number of front-ends is only one count.
Https://segmentfault.com/q/1010000004102176/a-1020000004102233
Database lock, file lock
It mainly uses the automatic lock function during mysql update execution.
When there are 138 requests on the page, the SQL statement is as follows:
Update tabl_x set xxx = 139 where xxx = 138;
This statementOnly onceWhen other requests are executed, 'XXX' is no longer 138, so all requests fail.