Skip to Content
数据库系统内幕
book

数据库系统内幕

by Alex Petrov
May 2020
Beginner to intermediate
319 pages
7h 3m
Chinese
China Machine Press
Content preview from 数据库系统内幕
简介与概述
|
167
8.6
系统同步性
从 FLP 不可能定理中可以看出时序假设是分布式系统的关键特征之一。在
异步系统
中,
我们不知道进程运行的相对速度,也不能保证在有限时间内或以特定顺序传递消息。进
程可能要花无限长的时间来响应,而且无法总是可靠地检测到进程故障。
对异步系统的主要批评在于上述假设不切实际:进程不可能具有
任意
不同的处理速度,
链路传递消息的时间也不会
无限
长。依赖时间能够简化推理,并提供时间上限的保证。
在异步模型中不一定能解决共识问题 [FISCHER85]。而且,不一定能设计出高效的异步
算法。对于某些任务,切实可行的解决方案很可能需要依赖时间 [ARJOMANDI83]。
我们可以放宽一些假设,认为系统是
同步
的。为此我们引入了时间的概念。在同步模型
下对系统进行推理要容易得多。它假定各进程的处理速度相近、传输延迟是有限的,并
且消息传递不会花任意长的时间。
同步系统也可以表示为同步的进程本地时钟:两个进程本地时间源之间的时间差存在上
限 [CACHIN11]。
在同步模型中设计系统可以使用超时机制。我们可以构建更复杂的抽象,例如领导者选
举、共识、故障检测以及基于它们的其他抽象。这使得最佳情况的场景更加健壮,但是
如果时序假设不成立则可能导致故障。例如:Raft 共识算法(参见 14.4 节)中,可能最
终有多个进程认为它们是领导者,为了解决该问题,我们强制滞后的进程接受其他进程
成为领导者;故障检测算法(参见第 9 章)可能会错误地将活动进程标记为故障,反之
亦然。设计系统时,我们必须考虑这些可能性。 ...
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