MySQL Read Locks and Write Locks

By:    Updated: February 27,2017

MySQL deals with concurrent read/write access typically implement a locking system that consists of two lock types: shared read locks and exclusive write locks.

 

MySQL read locks on a resource are shared, or mutually nonblocking: many clients can read from a resource at the same time and not interfere with each other. But MySQL write locks are exclusive. For example, they block both read locks and other write locks—to make sure that only have a single client writing to the resource at a given time and to prevent all reads when a client is writing.

 

In the database world, locking happens all the time: MySQL has to prevent one client from reading a piece of data while another is changing it. It performs this lock management internally in a way that is transparent much of the time.

More in Development Center
New on Valinv
Related Articles
Sponsored Links