当前位置:网站首页>Redis的ACID
Redis的ACID
2022-06-26 15:50:00 【华为云】
Redis的ACID
原子性
因为redis包含事务队列保存命令,所以它具有原子性。 事务队列中的所有命令都将执行或根本不执行。 如果在运行时发生错误,则redis不支持事务回滚。 命令发生错误不会影响下一个命令的执行。
一致性
redis从三个方面保证事务的一致性
入队时命令不存在或格式错误。 redis不会将此命令置于事务队列中。
如果命令在运行时发生错误,则这些错误命令不会对数据库进行任何更改,以确保一致性
如果服务器停止,则在服务器未持久化且重新启动后,数据明显匹配。 在RDB模式下,根据现有的RDB文件恢复数据以保持一致性。 在AOF模式下,通过AOF文件保持一致性。
隔离性
Redis是隔离的,因为它在单线程上执行事务,并串行执行事务
持久性
很明显,如果redis不是持久化的,事务也不是持久化的。 在RDB模式下,不会立即进行BGSAVE保存,因此也不能保证持久性。 在AOF模式下,appendfsync选项设置为always,程序在执行命令后调用同步函数以确保持久性。
总结
这就是redis的ACID,它具有原子性一致性和隔离性,在appendfsync选项设置为always的时候就有持久性。redis不支持事务回滚,而mysql的undolog日志保证事务的回滚操作,redo log将最细数据保存,从而保证事务的持久性,binlog用来记录数据库的更新数据的信息,查询数据的信息不会记录,它主要用于数据宕机的时候的数据恢复和主从复制。
redis 的事务的内容大概就这么多,让我们一起了解redis原理,一起运用到工作学习中去吧,谢谢大家的支持和鼓励,继续加油,继续努力,redis很重要,我们需要深入了解它。
️ 感谢大家
如果你觉得这篇内容对你挺有有帮助的话:
- 欢迎关注我️,点赞,评论,转发
- 关注
盼盼小课堂
,定期为你推送好文,还有群聊不定期抽奖活动,可以畅所欲言,与大神们一起交流,一起学习。 - 有不当之处欢迎批评指正。
边栏推荐
- Development, deployment and online process of NFT project (2)
- svg上升的彩色气泡动画
- 若依如何实现接口限流?
- 振动式液量检测装置
- 4 custom model training
- Ten thousand words! In depth analysis of the development trend of multi-party data collaborative application and privacy computing under the data security law
- I want to know how to open an account through online stock? Is online account opening safe?
- Auto Sharding Policy will apply Data Sharding policy as it failed to apply file Sharding Policy
- 还存在过有键盘的kindle?
- Svg savage animation code
猜你喜欢
Oilfield exploration problems
简单科普Ethereum的Transaction Input Data
首例猪心移植细节全面披露:患者体内发现人类疱疹病毒,死后心脏重量翻倍,心肌细胞纤维化丨团队最新论文...
JS creative icon navigation menu switch background color
Tencent Peking University's sparse large model training acceleration program het was selected into the VLDB of the international summit
Handwritten numeral recognition, run your own picture with the saved model
3 keras版本模型训练
Canvas three dot flashing animation
振动式液量检测装置
SAP OData 开发教程 - 从入门到提高(包含 SEGW, RAP 和 CDP)
随机推荐
神经网络“炼丹炉”内部构造长啥样?牛津大学博士小姐姐用论文解读
Svg savage animation code
振动式液量检测装置
【leetcode】331. Verifying the preorder serialization of a binary tree
9 use of tensorboard
AUTO sharding policy will apply DATA sharding policy as it failed to apply FILE sharding policy
我想知道如何通过线上股票开户?在线开户安全么?
NFT交易原理分析(2)
R语言plotly可视化:plotly可视化归一化的直方图(historgram)并在直方图中添加密度曲线kde、并在直方图的底部边缘使用geom_rug函数添加边缘轴须图
NFT contract basic knowledge explanation
How do I open an account on my mobile phone? Is online account opening safe?
I want to know how to open an account through online stock? Is online account opening safe?
3 keras版本模型训练
STEPN 新手入门及进阶
SAP OData development tutorial - from getting started to improving (including segw, rap and CDP)
golang 1.18 go work 使用
Tweenmax+svg switch color animation scene
Auto Sharding Policy will apply Data Sharding policy as it failed to apply file Sharding Policy
李飞飞团队将ViT用在机器人身上,规划推理最高提速512倍,还cue了何恺明的MAE...
Ten thousand words! In depth analysis of the development trend of multi-party data collaborative application and privacy computing under the data security law