Answer the question
In order to leave comments, you need to log in
Locks in mysql, is there an alternative?
There is a table, at a certain moment 20-30 requests can come at the same time. At this moment, a new record is created in the table for each, and at another time, you need to update the time and increase the number in it. Since there are a lot of requests coming at the same time, not all numbers add up and, as a result, not all data is taken into account in the next selecte. In order to avoid this, I began to use locks, but because of this, the speed of work drops. How can this be avoided?
Answer the question
In order to leave comments, you need to log in
not all numbers add up
Read about the queues, if on your fingers, then you need a separate script (daemon) that will take data in batches (by n records) from table 1 at certain intervals and sequentially read them and update table 2, the fact of processing can be fixed as using additional . fields ala "is_processed", and by creating a separate table, the rows in which will be deleted during their processing.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question