当前位置:网站首页>MySQL实战45讲 学习笔记(二)
MySQL实战45讲 学习笔记(二)
2022-01-15 02:31:34 【ordinaryBlog】
MySQL的日志系统
redo log(重做日志)
redo log为InnoDB特有的日志
作用:
用于记录事务操作的变化,记录的是数据修改之后的值。在MySQL宕机时,InnoDB通过redo log恢复数据,保证数据的完整性。即 保证即使数据库发生异常重启,之前提交的记录都不会丢失,这个能力称为crash-safe
在一条记录更新的时候,InnoDB引擎会先把记录写入redo log中,并更新内存。后续在系统较为空闲时,再将该操作写入磁盘中 (先写日志,再写磁盘)
结构:
(图片来自极客时间)redo log是循环写入的,write pos和check point之间可用来记录新的操作。check point之后是当前要擦除的操作。
binlog(归档日志)
binlog是属于MySQL Server层的,又称归档日志,属于逻辑日志,记录的是语句的原始逻辑,是以二进制形式存储的。
binlog和 redo log的区别
- redo log 是 InnoDB 引擎特有的;binlog 是 MySQL 的 Server 层实现的,所有引擎都可以使用。
- redo log 是物理日志,记录的是“在某个数据页上做了什么修改”;binlog 是逻辑日志,记录的是这个语句的原始逻辑
- redo log 是循环写的,空间大小固定;binlog 是可以追加写入的。“追加写”是指binlog 文件写到一定大小后会切换到下一个,并不会覆盖以前的日志。
执行一条更新语句的执行顺序
update T set c=c+1 where ID=2;
(图片来自极客时间)
通过两阶段提交 保证了数据的一致性
版权声明
本文为[ordinaryBlog]所创,转载请带上原文链接,感谢
https://blog.csdn.net/kang2411212/article/details/120604767
边栏推荐
- Analyse des données tichoo
- Tiktok data analysis platform
- Partage de l'industrie | tichoo Data to attend 2022 Overseas Short video Industry Summit
- [ticoo Information Station] tiktok and Cross - Border E - commerce Weekly Report
- Options d'analyse des données ticoo {infostation}
- Partage de l'industrie | Lu Shidong, PDG de tichoo Data Outlook Global Video e - commerce future Blueprint
- [ticoo Information Station]
- Noël Black Five
- YC Framework version update: v1.0 zero point two
- Lucene分词器
猜你喜欢
随机推荐
- JVM系列 -- 深入剖析垃圾收集器
- JVM系列--内存回收
- JVM系列--对象内存分配技术分析
- JVM系列--虚拟机的内存管理
- 系统性能瓶颈排查技术总结
- 使用redis的scan指令详解
- 实战--分布式id发号器
- 分布式事务之超详细的Seata实践记录
- TCP time_wait
- IP数据报头部
- 最大基环内向树
- MySQL实战45讲 学习笔记(七)
- MySQL实战45讲 学习笔记(六)
- Android从零开始搭建MVVM架构(1)(1),kotlin匿名函数
- Android事件分发机制五:面试官你坐啊,安卓上机面试题
- There will be two different stages between the breakthrough of science and technology and its real transformation into an inclusive technology
- [leetcode] force deduction 200 Number of islands
- HashShuffleManager
- Spark shuffle concept
- Go controls the metadata of grpc
- Altium Designer
- Android Event Distribution Mechanism 5: interviewer, you sit, Android on the machine Interview Question
- Android construit l'architecture mvvm à partir de zéro (1) (1), fonction anonyme kotlin
- MySQL Real Game 45 talk Learning notes (6)
- MySQL Real Game 45 talk Learning notes (7)
- Module 6 operation of the actual combat camp
- Android事件分發機制五:面試官你坐啊,安卓上機面試題
- Arbre intérieur maximal de l'anneau de base
- En - tête du datagramme IP
- TCP Time Attendez.
- Android内容提供器读取手机中的音乐文件信息,百度、阿里、滴滴、新浪的面试心经总结
- Android修炼系列(十一),kotlin静态方法
- Seata Practice record for Distributed transactions
- RSA basic principle and common attack methods
- Incremental replication of table data between two database servers
- Android修煉系列(十一),kotlin靜態方法
- Android Culture Series (11), kotlin Static Method
- Le fournisseur de contenu Android lit les informations des fichiers musicaux dans le téléphone mobile, baidu, Ali, Didi, Sina interview Summary
- Pratique - Distributed ID commander
- Explication détaillée de l'instruction Scan avec redis