当前位置:网站首页>数据库设计的酸(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 翻译成了“基本的”,更接近本意的解释大概是“根本上”。
边栏推荐
- [Paper Notes] MapReduce: Simplified Data Processing on Large Clusters
- shell脚本:for循环与while循环
- Hash table lookup (hash table)
- 今年七夕,「情蔬」比礼物更有爱
- QT: The Magical QVarient
- ffmpeg enumeration decoders, encoders analysis
- 高项 02 信息系统项目管理基础
- Summary of domestic environments supported by SuperMap
- You may use special comments to disable some warnings. 报错解决的三种方式
- Step by step how to perform data risk assessment
猜你喜欢

为什么pca分量没有关联

用CH341A烧录外挂Flash (W25Q16JV)

Dynamic management of massive service instances

Simple description of linked list and simple implementation of code

21 Days Learning Challenge (2) Use of Graphical Device Trees

【滤波跟踪】基于matlab无迹卡尔曼滤波惯性导航+DVL组合导航【含Matlab源码 2019期】

基于生长的棋盘格角点检测方法

The linear table lookup

龙蜥社区第二届理事大会圆满召开!理事换届选举、4 位特约顾问加入

Confessing the era of digital transformation, Speed Cloud engraves a new starting point for value
随机推荐
今年七夕,「情蔬」比礼物更有爱
Leading the highland of digital medicine, Zhongshan Hospital explores to create a "new paradigm" for future hospitals
The pit of std::string::find return value
大像素全景制作完成后,推广方式有哪些?
In 2022, you still can't "low code"?Data science can also play with Low-Code!
Turn: Charles Handy: Who you are is more important than what you do
[Software testing] unittest framework for automated testing
Web3.0 Dapps——通往未来金融世界的道路
Kubernetes 网络入门
2022高处安装、维护、拆除考试题模拟考试题库及在线模拟考试
Summary of domestic environments supported by SuperMap
rpc-remote procedure call demo
ASP.NET应用程序--Hello World
龙蜥社区第二届理事大会圆满召开!理事换届选举、4 位特约顾问加入
Use SuperMap iDesktopX data migration tool to migrate map documents and symbols
Android Practical Development - Kotlin Tutorial (Introduction - Login Function Implementation 3.3)
YYGH-13-Customer Service Center
2022.8.4-----leetcode.1403
How to Add Category-Specific Widgets in WordPress
[TA-Frost Wolf_may-"Hundred Talents Project"] Graphics 4.3 Real-time Shadow Introduction