当前位置:网站首页>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很重要,我们需要深入了解它。
️ 感谢大家
如果你觉得这篇内容对你挺有有帮助的话:
- 欢迎关注我️,点赞,评论,转发
- 关注
盼盼小课堂,定期为你推送好文,还有群聊不定期抽奖活动,可以畅所欲言,与大神们一起交流,一起学习。 - 有不当之处欢迎批评指正。
边栏推荐
- NFT Platform Security Guide (2)
- Super double efficiency! Pycharm ten tips
- 今年高考英语AI得分134,复旦武大校友这项研究有点意思
- 若依打包如何分离jar包和资源文件?
- 2 three modeling methods
- Oilfield exploration problems
- 【leetcode】48. Rotate image
- Big talk Domain Driven Design -- presentation layer and others
- IAR工程适配GD32芯片
- SAP OData development tutorial - from getting started to improving (including segw, rap and CDP)
猜你喜欢

What is the process of switching C # read / write files from user mode to kernel mode?

Panoramic analysis of upstream, middle and downstream industrial chain of "dry goods" NFT

El dialog drag and drop, the boundary problem is completely corrected, and the bug of the online version is fixed

10 tf.data

NFT 平台安全指南(1)

How to configure and use the new single line lidar

Summary of data interface API used in word search and translation applications

5000字解析:实战化场景下的容器安全攻防之道

NFT合约基础知识讲解

Super double efficiency! Pycharm ten tips
随机推荐
【思考】在买NFT的时候你在买什么?
Leetcode one week race 298, first three questions
今年高考英语AI得分134,复旦武大校友这项研究有点意思
NFT transaction principle analysis (1)
golang 临时对象池优化
Transaction input data of Ethereum
全面解析Discord安全问题
C language reading data
JVM笔记
svg环绕地球动画js特效
10 tf.data
大话领域驱动设计——表示层及其他
JS text scrolling scattered animation JS special effect
Summary of data interface API used in word search and translation applications
Reflection modification final
牛客小白月赛50
【leetcode】331. Verifying the preorder serialization of a binary tree
Everyone is a scientist free gas experience Mint love crash
Solana扩容机制分析(2):牺牲可用性换取高效率的极端尝试 | CatcherVC Research
SAP OData 开发教程 - 从入门到提高(包含 SEGW, RAP 和 CDP)