A simple understanding of MySQL locks, transactions, and MVCC

mysql TutorialThe column introduces a simple understanding of MySQL locks, transactions, and MVCC. How does MySQL implement ACID for transactions? The transaction has the four characteristics of ACID, so how does MySQL implement these four attributes of the transaction? Atomicity Either all succeed, or all fail. MySQL achieves atomicity by recording undo_log. undo_log is rollback log, write undo_log to disk before real SQL execution, and then Operate on database data. If an exception or rollback occurs, the reverse operation can be performed according to the undo_log to restore the data as it was before the transaction was executed. persistent sex Once a transaction is committed normally, its effect on the database should be permanent. At this time, even if the system crashes, the modified data will not be lost. As the storage engine of MySQL, InnoDB stores data on disk, but if disk IO is required for every read and write data, the efficiency will be very low. To this end, InnoDB provides a cache (Buffer Pool) as a buffer for accessing the database: when reading data from the database, it will first read from the Buffer Pool, if there is no Buffer Pool, it will be read from the…

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索