It's called concurrency. Database servers can't see into client input buffers, much less manipulate them, so RDBMSs use
transactions to turn edit events into uncorruptible or at least error-recoverable action sequences.
It requires the transactional storage engine InnoDB. There are two main approaches, optimistic and pessimistic.
Optimistic relies on the likelihood that it's rare for two users to try to change the same row at exactly the same time; usually there's a bit of a time diff, so the first edit will usually be done before the second starts. Against the possibility of a collision, graceful
rollback logic and retry logic are coded into the transaction.
Pessimistic concurrency codes against the likelihood of such collisions, so necessarily it's less convenient, more intrusive.
For details see
https://dev.mysql.com/doc/refman/8.0/en/innodb-transaction-model.html
Edited 1 time(s). Last edit at 12/03/2018 12:51PM by Peter Brawley.