当前位置:网站首页>ACID事务理论
ACID事务理论
2022-07-05 11:52:00 【詹Sir(开源字节)】
什么是ACID
一个事务有四个基本特性,也就是我们常说的(ACID):
- Atomicity(原子性):事务是一个不可分割的整体,事务内所有操作要么全做成功,要么全失败。
- Consistency(一致性):务执行前后,数据从一个状态到另一个状态必须是一致的(A向B转账,不能出现A扣了钱,B却没收到)。
- Isolation(隔离性): 多个并发事务之间相互隔离,不能互相干扰。
- Durability(持久性):事务完成后,对数据库的更改是永久保存的,不能回滚。
ACID靠什么保证的呢?
以MySQL为例:
A原子性由undo log日志保证,它记录了需要回滚的日志信息,事务回滚时撤销已经执行成功的sql
C一致性一般由代码层面来保证
I隔离性由MVCC来保证
D持久性由内存+redo log来保证,mysql修改数据同时在内存和redo log记录这次操作,事务提交的时候通过redo log刷盘,宕机的时候可以从redo log恢复
如若转载,请注明出处:开源字节 https://sourcebyte.cn/article/178.html
边栏推荐
猜你喜欢

pytorch-权重衰退(weight decay)和丢弃法(dropout)
![[pytorch modifies the pre training model: there is little difference between the measured loading pre training model and the random initialization of the model]](/img/ad/b96e9319212cf2724e0a640109665d.png)
[pytorch modifies the pre training model: there is little difference between the measured loading pre training model and the random initialization of the model]

Uniapp + unicloud + Unipay realize wechat applet payment function
调查显示传统数据安全工具在60%情况下无法抵御勒索软件攻击

互联网公司实习岗位选择与简易版职业发展规划

Use and install RkNN toolkit Lite2 on itop-3568 development board NPU

Redis集群(主从)脑裂及解决方案

COMSOL -- three-dimensional graphics random drawing -- rotation

MySQL 巨坑:update 更新慎用影响行数做判断!!!

【L1、L2、smooth L1三类损失函数】
随机推荐
leetcode:1200. Minimum absolute difference
yolov5目標檢測神經網絡——損失函數計算原理
【load dataset】
vscode快捷键
[pytorch modifies the pre training model: there is little difference between the measured loading pre training model and the random initialization of the model]
Sentinel sentinel mechanism of master automatic election in redis master-slave
Vscode shortcut key
Project summary notes series wstax kt session2 code analysis
COMSOL -- establishment of 3D graphics
[yolov3 loss function]
汉诺塔问题思路的证明
【TFLite, ONNX, CoreML, TensorRT Export】
[singleshotmultiboxdetector (SSD, single step multi frame target detection)]
如何让你的产品越贵越好卖
C#实现WinForm DataGridView控件支持叠加数据绑定
Acid transaction theory
C # implements WinForm DataGridView control to support overlay data binding
[mainstream nivida graphics card deep learning / reinforcement learning /ai computing power summary]
基于Lucene3.5.0怎样从TokenStream获得Token
【load dataset】