当前位置:网站首页>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很重要,我们需要深入了解它。
️ 感谢大家
如果你觉得这篇内容对你挺有有帮助的话:
- 欢迎关注我️,点赞,评论,转发
- 关注
盼盼小课堂,定期为你推送好文,还有群聊不定期抽奖活动,可以畅所欲言,与大神们一起交流,一起学习。 - 有不当之处欢迎批评指正。
边栏推荐
- Everyone is a scientist free gas experience Mint love crash
- 5000字解析:实战化场景下的容器安全攻防之道
- 5 model saving and loading
- What is the difference between stm32f1 and gd32f1?
- How to create your own NFT (polygon) on opensea
- NFT 平台安全指南(2)
- 8 user defined evaluation function
- AUTO sharding policy will apply DATA sharding policy as it failed to apply FILE sharding policy
- Anaconda3安装tensorflow 2.0版本cpu和gpu安装,Win10系统
- I want to know how to open an account through online stock? Is online account opening safe?
猜你喜欢

SVG大写字母A动画js特效

零知识 QAP 问题的转化

全面解析Discord安全问题

油田勘探问题

STEPN 新手入门及进阶

Solana capacity expansion mechanism analysis (1): an extreme attempt to sacrifice availability for efficiency | catchervc research

Application of ansible automation

Solana扩容机制分析(2):牺牲可用性换取高效率的极端尝试 | CatcherVC Research

Reflection modification final

svg canvas画布拖拽
随机推荐
svg环绕地球动画js特效
[problem solving] the loading / downloading time of the new version of webots texture and other resource files is too long
How to create your own NFT (polygon) on opensea
Stepn novice introduction and advanced
R language plotly visualization: Violin graph, multi category variable violin graph, grouped violin graph, split grouped violin graph, two groups of data in each violin graph, each group accounts for
11 introduction to CNN
NFT 项目的开发、部署、上线的流程(2)
3. Keras version model training
js文本滚动分散动画js特效
Anaconda3安装tensorflow 2.0版本cpu和gpu安装,Win10系统
Svg rising Color Bubble animation
Simple use of tensor
牛客小白月赛50
(1) Keras handwritten numeral recognition and recognition of self written numbers
Selenium chrome disable JS disable pictures
Auto Sharding Policy will apply Data Sharding policy as it failed to apply file Sharding Policy
SVG大写字母A动画js特效
Transformation of zero knowledge QAP problem
8 user defined evaluation function
How do I open an account on my mobile phone? Is online account opening safe?