DEV Community

Discussion on: Need idea to improve mysql's lock performance

Collapse
 
proticm profile image
Milos Protic

An alternative approach would be to handle these things by using Database Concurrency. You should have a row version column (usually int or timespan type) and with it, you will ensure the correctness of the data.

For example, if two users access the same row and the first one updates it, the second one will have the incorrect data. The first user will update the row version which will indicate that the other user should reload. Usually, a message is displayed that the data is in use to the user with invalid data.