Skip to Content
数据库系统内幕
book

数据库系统内幕

by Alex Petrov
May 2020
Beginner to intermediate
319 pages
7h 3m
Chinese
China Machine Press
Content preview from 数据库系统内幕
194
|
第
11
章
性和可用性,还要从同步代价的方面考虑一致性 [ATTIYA94]。同步代价可能包括时延、
执行额外操作所花费的 CPU 周期、用于持久化恢复信息的磁盘 I/O、等待时间、网络 I/
O,以及一切可以通过避免同步而节省的代价。
首先,我们将重点关注操作结果的可见性和传播。回到并发读写的例子,通过将写入按
照依赖关系一个接一个地放置,或定义一个新值被传播出去的时间点,我们就能限制可
能的历史数量。
我们从执行数据读写操作的
进程
(客户端)的角度来讨论一致性模型。由于我们在数据
复制的上下文中讨论一致性,因此我们假设数据库可以有多个副本。
11.5.1
严格一致性
严格一致性
(strict consistency)相当于完全透明的复制:任何进程的任何写入都可
以立即被任何进程的后续的读操作读取。它涉及全局时钟的概念,如果在时刻 t
1
有
write(x, 1),则任何 read(x) 的操作将在时刻 t
2
>t
1
时返回新写入的值 1。
不幸的是,这只是一个理论模型,且不可能实现,因为物理定律和分布式系统的工作方
式限制了事情发生的速度 [SINHA97]。
11.5.2
可线性化
可线性化
(linearizability)是最强的单对象、单操作一致性模型。该模型下,在写操作
开始和结束之间的某个时间点,写操作的效果严格一次性地对所有读取者可见,没有客
户端会观察到状态转移、部分(即未完成的、仍在进行中的)或不完全(即在完成之前
中断的)的写入操作 [LEE15]。
并发操作表现为可见性属性所支持的可能的顺序历史记录之一。可线性化有一定的不确 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

解密金融数据

解密金融数据

Justin Pauley

Publisher Resources

ISBN: 9787111655169