当前位置:网站首页>redolog和binlog
redolog和binlog
2022-06-24 06:51:00 【hy;】
mysql 的日志系统
mysql 中有两种重要的日志
redolog
innodb引擎提供
逻辑日志,记录对数据的操作,必须id=2这行+1
redolog 日志解决了什么问题?
我们都直到频繁写磁盘 效率是非常低的,所以mysql设计时就通过日志的方式来解决这个问题
mysql 在对表做更新操作时,会先记录一个redo log日志,innodb等空闲时间再去写入磁盘,这个操作也被称为WAL(write-Ahead-Loggin)
redolog 是固定大小的,从头开始写,写到末尾又回到开头循环写
redolog 之后记录未刷盘的日志
有了redo log,InnoDB就可以保证即使数据库发生异常重启,之前提交的记录都不会丢失,这个能力称为crash-safe。
binlog
binlog 由mysql server 提供
物理日志记录在数据页上做的修改 binlog 不会覆盖之前的日志
看到这里你可能会问 为什么binlog 不支持crash-safe ?
前面说了 binlog 记录的全量日志,记录所有的操作redolog记录的时未刷盘操作
当数据库宕机恢复后 binlog无法知道数据库是从什么宕机的 无法精确恢复
而redolog 只需要刷盘之后就可以恢复数据
两阶段提交
保证binlog 和 redolog 都被写入
边栏推荐
- 面试中的最常被问到的两种锁
- Reppoints: Microsoft skillfully uses deformation convolution to generate point sets for target detection, full of creativity | iccv 2019
- atguigu----16-自定义指令
- 智能指针备注
- js实现查看一个数组对象中是否包含另一个数组对象中的值
- How to realize multi protocol video capture and output in video surveillance system?
- Baidu map, coordinate inversion, picking coordinate position
- Explain the input attribute in PHP (hide the read-only restriction)
- Thread considerations
- Commandes de console communes UE
猜你喜欢

第 3 篇:绘制三角形

【资料上新】迅为基于3568开发板的NPU开发资料全面升级

Chapter 3: drawing triangles

免费ICP域名备案查接口

Alibaba cloud full link data governance

GPU is not used when the code is running

Cold thinking on the hot track: multiplier effect is the fundamental requirement of East West calculation

Hongmeng OS development III

First acquaintance with JUC - day01

Cloud development who is the source code of undercover applet
随机推荐
How to realize multi protocol video capture and output in video surveillance system?
用Ngrok 配置属于自己的免费外网域名
2022年PMP项目管理考试敏捷知识点(1)
智能指针备注
Free ICP domain name filing interface
Wechat cloud hosting hot issues Q & A
日期、时间库使用备注
New ways to play web security [6] preventing repeated use of graphic verification codes
Exness: Powell insisted on his anti inflation commitment and pointed out that recession is possible
行内元素、块元素、行内块元素
Explain the input attribute in PHP (hide the read-only restriction)
RDD的执行原理
某问答社区App x-zse-96签名分析
线程的阻塞问题
Thread blocking
希尔伯特-黄变换
C code writing specification
First acquaintance with JUC - day01
基于Distiller的模型压缩工具简介
The two most frequently asked locks in the interview