当前位置:网站首页>数据库设计的酸(ACID)碱(BASE)原则
数据库设计的酸(ACID)碱(BASE)原则
2022-08-05 03:26:00 【郝开】
事务
事务是作为单个逻辑工作单元执行的一系列操作,要么完全地执行,要么完全地不执行。
让我们来先看一眼事务的状态机模型。
图为事务的五个阶段
事务必须遵循 ACID 原则。
ACID 酸原则
ACID 是关系型数据库的事务执行过程中,为了保证数据被可靠写入而必须遵循的原则。
Atomicity 原子性
事务的操作要么全部执行,要么全不执行。
Consistency 一致性
在事务开始前和结束后,数据库的完整性约束没有被破坏;但执行过程中允许临时的破坏。
Isolation 隔离性
事务之间互不干扰,一个事务看不到另一事务执行中途的数据变更,也无法与另一事务交互。
Durability 持久性
事务结束后,所作变更将写入数据库,不再被回滚,即使数据库宕机重启。
RDBMS 为了如上四点所述的极高的一致性,而没有强调其扩展性。
BASE 碱原则
Basically Availability 基本可用性
数据库最基本的要求是可用性。
Soft-state 软状态
Soft-state 可视为 stateless 和 stateful 的中间状态。
stateless 指多条请求之间没有上下文联系,这将有助于数据库的简化、扩展和恢复。
stateful 是指同连接的多条请求上下文之间有所联系。
soft-state 一般视为服务器在有限度的资源(一般是时间)内维持上下文,过期则抛弃状态回归默认状态。
Eventually Consistency 最终一致性
允许因延时等出现临时的数据不一致现象,只要数据最终是一致的就可以。
Basically Availability 要注意一点。大概是翻译的问题,将这里的 Basically 翻译成了“基本的”,更接近本意的解释大概是“根本上”。
边栏推荐
- Thinking (88): Use protobuf custom options for multi-version management of data
- leetcode-每日一题1403. 非递增顺序的最小子序列(贪心)
- Solve the problem of port occupancy Port xxxx was already in use
- 2022 Hangzhou Electric Multi-School 1st Game
- .NET Application -- Helloworld (C#)
- Dameng 8 database export and import
- 论治理与创新,2022 开放原子全球开源峰会 OpenAnolis 分论坛圆满落幕
- CPDA|How Operators Learn Data Analysis (SQL) from Negative Foundations
- ASP.NET application--Hello World
- Android 面试题——如何徒手写一个非阻塞线程安全队列 ConcurrentLinkedQueue?
猜你喜欢
Leading the highland of digital medicine, Zhongshan Hospital explores to create a "new paradigm" for future hospitals
Beyond YOLO5-Face | YOLO-FaceV2 officially open source Trick+ academic point full
Beidou no. 3 short message terminal high slope in open-pit mine monitoring programme
dmp (dump) dump file
Why did they choose to fall in love with AI?
Developing Hololens encountered The type or namespace name 'HandMeshVertex' could not be found..
【软件测试】自动化测试之unittest框架
Growth-based checkerboard corner detection method
Dive into how it works together by simulating Vite
MRTK3开发Hololens应用-手势拖拽、旋转 、缩放物体实现
随机推荐
Kubernetes 网络入门
达梦8数据库导出导入
通过模拟Vite一起深入其工作原理
shell脚本:for循环与while循环
Open Source License Description LGPL
Solana NFT开发指南
token、jwt、oauth2、session解析
Android实战开发-Kotlin教程(入门篇-登录功能实现 3.3)
Ice Scorpion V4.0 attack, security dog products can be fully detected
引领数字医学高地,中山医院探索打造未来医院“新范式”
On governance and innovation, the 2022 OpenAtom Global Open Source Summit OpenAnolis sub-forum came to a successful conclusion
How to Add Category-Specific Widgets in WordPress
2022.8.4-----leetcode.1403
Use SuperMap iDesktopX data migration tool to migrate ArcGIS data
Countdown to 2 days|Cloud native Meetup Guangzhou Station, waiting for you!
Native js realizes the effect of selecting and canceling all the multi-select boxes
Flink 1.15.1 Cluster Construction (StandaloneSession)
Use SuperMap iDesktopX data migration tool to migrate map documents and symbols
This year's Qixi Festival, "love vegetables" are more loving than gifts
用CH341A烧录外挂Flash (W25Q16JV)