Known as one of the most popular open source database, MySQL is widely used in various scenarios, Alibaba Cloud provides high available ApsaraDB RDS for MySQL with enhanced MySQL service reduced enterprise’s database expenses, and helped enterprises utilize technology to fight against coronavirus.
MYSQL Inndodb's redo log and binlog appear to be very similar on the surface. However, there is a big difference in nature:
First: REDO log is generated at the InnoDB storage Engine layer, and Binlog is generated on top of the MySQL database, and the binary log is not just for the InnoDB storage engine, and any storage engine in the MySQL database will have a binary log for changes to the database.
Second: The content form of the two kinds of logging is different. MySQL's binlog is a logical log, and its record is the corresponding SQL statement. The redo logs at the InnoDB storage engine level are physical logs.
Third: The two logs are different from the point at which the records are written to disk, and the binary log is written only once after the transaction commit has completed. The redo logs of the InnoDB storage engine are continuously written in the transaction, and the logs are not written in the order in which the transactions are committed.
The binary log is only logged when the transaction commits, and for each transaction, it is only logged when the transaction commits, and for each transaction, only one log of the corresponding transaction is included. For the redo logs of the InnoDB storage engine, because their records are physical operations logs, each transaction corresponds to multiple log entries, and the redo log writes for the transaction are concurrent, not written at transaction commits, and the order in which they are recorded in the file is not the order in which the transaction begins.
This article is from the "12024114" blog, please be sure to keep this source http://12034114.blog.51cto.com/12024114/1856661
The difference between MYSQL InnoDB's redo log and Binlog