当前位置:网站首页>Three major logs in mysql
Three major logs in mysql
2022-08-10 23:11:00 【Mu Xiaotong】
redoLog
redoLog is a log specific to the InnoDB engine. Every time an operation is performed, the redoLog log will be written first.What is recorded is, at a certain time, what operations are done to which data in which data pages, and what values are modified.This log is somewhat physical in nature.
As long as this log is written, there is no fear of sending exceptions in subsequent operations, because this log can continue the previous operation.
Moreover, the redoLog log is written cyclically in a fixed space, that is to say, when the space for storing the redoLog log is not enough, the latest log will overwrite the oldest log.
binLog
binLog is the log of the server layer. Whenever there is a data update operation, this log will be written.Record which data has the number of ids and what value has been modified. That is to say, the binLog log is logical in nature, and directly records the modification record of a certain data.
The binLog log is mainly used for data synchronization and data recovery in the master-slave mechanism. You can quickly know what the latest value of a certain piece of data should be through the binLog log.The Masert side sends binLog to each Slave side, so as to achieve the purpose of master-slave data consistency; and data recovery is to use the mysql binLog tool to recover data.
And this log is written additionally and will not overwrite the history.
undoLog
undoLog is the latest version of a piece of data every time it is modified, forming a version chain log of the data. When a transaction rollback operation occurs, the data can be restored directly through the specified version.
And it is very useful in transaction control, you can control the version that each transaction can see and thus control the isolation level of the transaction (only useful for read committed and non-repeatable reads)
Summary
redoLog is the log of the InnoDB engine, and is written cyclically, which will overwrite historical data.The log of the record is of a physical nature. It is a log that records all operations of the transaction in innoDB, including whether the record is written to the binLog. Only when the redoLog log records the commit transaction commit, the operation is completed.
The binLog log is the log of the server layer. It is logical in nature. It records what changes have been made to each piece of data. It is mainly used for master-slave replication and data recovery.
The undoLog log is the version chain control of the data. It is used in conjunction with MVCC. Each time the data is modified, a record will be generated, and the version that the transaction can see when querying is controlled.
边栏推荐
猜你喜欢
随机推荐
带你造轮子,自定义一个随意拖拽可吸边的View
MySQL: MySQL Cluster - Principle and Configuration of Master-Slave Replication
What is Jmeter? What are the principle steps used by Jmeter?
链表中的节点每k个一组翻转
高学历毕业生,该学单片机还是plc?
y93.第六章 微服务、服务网格及Envoy实战 -- Envoy配置(四)
威纶通触摸屏如何在报警的同时,显示出异常数据的当前值?
罗克韦尔AB PLC RSLogix5000中计数器指令使用方法介绍
"DevOps Night Talk" - Pilot - Introduction to CNCF Open Source DevOps Project DevStream - feat. PMC member Hu Tao
ArcGIS应用基础知识
RecyclerView滑动监听
Research on multi-element N-k fault model of power system based on AC power flow (implemented by Matlab code) [Power System Fault]
68:第六章:开发文章服务:1:内容梳理;article表介绍;创建【article】文章服务;
Why general company will say "go back messages such as" after the end of the interview, rather than just tell the interviewer the result?
LeetCode每日两题01:反转字符串 (均1200道)方法:双指针
【640. Solving Equations】
make & cmake
如何反弹shell
浅谈jsfuck编码
二叉树 | 代码随想录学习笔记