Skip to Content
数据库系统内幕
book

数据库系统内幕

by Alex Petrov
May 2020
Beginner to intermediate
319 pages
7h 3m
Chinese
China Machine Press
Content preview from 数据库系统内幕
246
|
第
14
章
同步中,模型本身并未指定顺序,只要它提供的顺序对所有成员一致即可,某些实现利
用这一点来提高性能 [BIRMAN10]。
各进程具有相同的组视图,每条消息都关联了一个组标识:只要是同一个组的进程,就
能看到相同的消息。
当参与者加入、离开组或发生故障被迫退出组时,组视图就会改变。组视图的变更会被
通知给所有成员。每个消息都唯一地关联了其发送者所属的组。
虚同步区分消息的
接收
(某一个组成员接收到消息时)和
送达
(所有组成员都接收到消
息时)。如果消息是从某个视图
发送
的,则只能在同一视图中
送达
,这可以通过比较当
前组与消息关联的组来确定。收到的消息在队列中保持等待状态,直到通知该进程消息
已成功送达。
由于每个消息都属于某个特定的组,除非该组中的所有进程都在视图变更之前
接收
到该
消息,否则组成员不能认为此消息已
送达
。这意味着所有消息都是在视图变更
之间
发送
并送达的,这为我们提供了原子传递的保证。这种情况下,组视图变更就像是消息广播
无法通过的屏障。
一些全序广播算法使用定序器(一个负责决定消息顺序的单独进程)对消息进行排序。
这样的算法可能更易于实现,但依赖于对领导者故障的检测以保证活动性。使用定序器
可以提高性能,因为我们无须为每条消息在各进程之间建立共识,而是使用定序器本地
的视图。这种方法也可以通过对请求进行分区来扩展。
尽管技术上很可靠,但虚同步并未被广泛采用,在商业系统中也很罕见 [BIRMAN06]。
14.2.2 Zookeeper
原子广播
原子广播最流行、最广为人知的一个实现是 Apache ...
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