Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to understand the binlog group commit technology of MarriDB/MySQL

2025-01-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces "how to understand MarriDB/MySQL 's binlog group commit technology". In daily operation, I believe many people have doubts about how to understand MarriDB/MySQL 's binlog group commit technology. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the questions of "how to understand MarriDB/MySQL 's binlog group commit technology"! Next, please follow the editor to study!

We know that the operating system uses page caching to fill the gap between memory access speed and disk access speed. Usually, writes to disk files are written to the page cache first

It is then up to the operating system to decide when to flush the modified dirty pages to disk. If you want to ensure that the changes are persistently written to disk, you must call fsync or fdatasync. In a relational database

In order to satisfy the persistence attribute in ACID, that is, after the transaction is committed and successfully returned to the client, you must ensure that all changes to the transaction cannot be lost. Whether in the case of a database program crash

In the case of downtime or power outage on the server where the database is located, the data must not be lost, which requires the database to call fsync or fdatasync during the transaction commit to persist the data.

To the disk. Fsync is an expensive system call. For an ordinary disk, only a few hundred fsync operations can be completed per second. Obviously, fsync will limit the number of transactions committed per second and become a relationship.

The bottleneck of the database.

For MarriDB/MySQL, the situation is getting worse. When binlog is turned on, in order to ensure the consistency of data between the master and slave libraries, MarriDB/MySQL uses the transactional

Two-phase submission agreement. In this case, in order to meet the data persistence requirements, the commit of a transaction will result in up to three fsync operations.

In order to increase the number of transaction commits per unit time when binlog is turned on in MarriDB/MySQL, it is necessary to reduce the number of fsync calls caused by each transaction commit. MarriDB starts with version 5.3

Binlog group commit technology is introduced to solve this problem. MySQL has also added binlog group commit technology since version 5.6.

The basic idea of binlog group commit is that multiple concurrently committed transactions share a common fsync operation to achieve the persistence of binlog modifications.

At this point, the study on "how to understand MarriDB/MySQL 's binlog group commit technology" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report