当前位置:网站首页>数据库设计的酸(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 翻译成了“基本的”,更接近本意的解释大概是“根本上”。
边栏推荐
- After the large pixel panorama is completed, what are the promotion methods?
- Simple description of linked list and simple implementation of code
- IJCAI2022 | DictBert: Pre-trained Language Models with Contrastive Learning for Dictionary Description Knowledge Augmentation
- 2022-08-04 第六小组 瞒春 学习笔记
- dmp (dump) dump file
- 龙蜥社区第二届理事大会圆满召开!理事换届选举、4 位特约顾问加入
- The linear table lookup
- 今年七夕,「情蔬」比礼物更有爱
- The pit of std::string::find return value
- Slapped in the face: there are so many testers in a certain department of byte
猜你喜欢
A small tool to transfer files using QR code - QFileTrans 1.2.0.1
Beyond YOLO5-Face | YOLO-FaceV2 officially open source Trick+ academic point full
Growth-based checkerboard corner detection method
leetcode-每日一题1403. 非递增顺序的最小子序列(贪心)
Question about #sql shell#, how to solve it?
Dynamic management of massive service instances
Countdown to 2 days|Cloud native Meetup Guangzhou Station, waiting for you!
【滤波跟踪】基于matlab无迹卡尔曼滤波惯性导航+DVL组合导航【含Matlab源码 2019期】
Solana NFT开发指南
Is your data safe in this hyperconnected world?
随机推荐
开发Hololens遇到The type or namespace name ‘HandMeshVertex‘ could not be found..
The sword refers to Offer--find the repeated numbers in the array (three solutions)
Kubernetes 网络入门
.NET应用程序--Helloworld(C#)
Dynamic management of massive service instances
Thinking (88): Use protobuf custom options for multi-version management of data
dmp (dump) dump file
Leading the highland of digital medicine, Zhongshan Hospital explores to create a "new paradigm" for future hospitals
Developing Hololens encountered The type or namespace name 'HandMeshVertex' could not be found..
2022高处安装、维护、拆除考试题模拟考试题库及在线模拟考试
Beyond YOLO5-Face | YOLO-FaceV2 officially open source Trick+ academic point full
ffmpeg enumeration decoders, encoders analysis
You may use special comments to disable some warnings. 报错解决的三种方式
The usage of try...catch and finally in js
STM32 uses stm32cubemx LL library series tutorial
【软件测试】自动化测试之unittest框架
Defect detection (image processing part)
用Unity发布APP到Hololens2无坑教程
905. 区间选点
Linux下常见的开源数据库,你知道几个?