Member-only story
An In-Depth Analysis of the MVCC Principle of MySQL
MySQL and MVCC
When multiple transactions operate on the same row of data, various concurrency problems will occur. MySQL solves these problems through four isolation levels.
The read uncommitted isolation level is the loosest, and basically, no isolation is done, so it is very simple to implement.
The read-commit isolation level is that each time a statement is executed (including query and update statements), a consistent view is generated to ensure that the current transaction can see the data submitted by other transactions.
The implementation of the repeatable read isolation level is that each transaction will generate a consistent view when it is opened. When other transactions are committed, it will not affect the data in the current transaction. To ensure this, MySQL is through the multi-version control mechanism MVCC to be realized.
The isolation level of the serializable isolation level is relatively high, which is achieved by locking, so MySQL has a set of locking mechanisms.
Both read commit and repeatable read isolation levels depend on the implementation of the MVCC multi-version control mechanism. Today we will discuss the MVCC multi-version control mechanism in MySQL.