Skip to Content
数据库系统内幕
book

数据库系统内幕

by Alex Petrov
May 2020
Beginner to intermediate
319 pages
7h 3m
Chinese
China Machine Press
Content preview from 数据库系统内幕
反熵和传播
|
213
及其每个接收者都必须在工作时间上有重叠,而这在某些情况下可能难以实现。
为了放宽这些限制,我们可以假设
某些
更新可能会传播失败。协调者尽力将消息传递给所
有可用的参与者,而一旦出现故障,反熵(anti-entropy)机制会让节点重新同步。这样,
传递消息的责任由系统中所有节点共同承担,并分成两个步骤:主要传递和定期同步。
熵
(entropy)是一种衡量系统无序程度的属性。在分布式系统中,熵表示节点之间的状
态分歧程度。我们希望将熵保持在最低的水平,有许多技术可以帮助减少熵。
反熵机制通常用于在主要传递机制失败的情况下将节点恢复最新状态。即使协调者在某
个时刻发生故障,系统也可以继续正常运行,因为其他节点将继续传播信息。换句话
说,在最终一致的系统中,反熵被用来降低收敛的时间界限。
为了保持各节点的同步,反熵会触发一个后台或前台进程,比较和调和丢失或冲突的记
录。后台反熵进程会利用 Merkle 树之类的辅助数据结构,从更新日志中识别出分歧的数
据。前台反熵进程会捎带(piggyback)地在读取或写入请求上附加额外逻辑,比如提示
移交、读修复等。
如果多副本系统中的副本间出现分歧,为了恢复一致性和同步,我们必须通过成对比较
副本状态来查找和修复丢失的记录。对于大型数据集这会非常耗时:我们必须从两个节
点分别读出整个数据集,并将尚未传播的、包含最新状态的更改通知相关副本。为了降
低成本,我们可以考虑副本过期的方式以及数据访问的模式。
12.1
读修复
读取时最容易检测出副本之间的差异,因为此时我们可以联系副本,从每个副本上查询 ...
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