Reputation: 13
What if an application has thousands of simultaneous users at any given time and throughout the course of it's existence 2 or more users perform an action that causes the app to update a database table due to a request performed at the exact same time (to the nano second).
What would happen, would MySQL simply put one over the other and the change will reflect the last or would the world come to an end due to some sort of internal conflict error?
Upvotes: 1
Views: 675
Reputation:
It depends on the storage engine.
MyISAM will not allow concurrent updates to the same table even if different rows are affected because MyISAM always locks the whole table.
Whereas InnoDB will allow to update two different rows concurrently as it does row level locking.
Upvotes: 0