Skip to Content
数据库系统内幕
book

数据库系统内幕

by Alex Petrov
May 2020
Beginner to intermediate
319 pages
7h 3m
Chinese
China Machine Press
Content preview from 数据库系统内幕
复制和一致性
|
189
故意
违反任何保证,但是在网络分区的情况下,允许系统削弱和违反保证。
换句话说,CAP 描述了一系列潜在的可选项,而在这些选项的两端是以下两种系统:
一致性和分区容忍系统(CP 系统)
CP 系统更倾向拒绝请求,而不是提供可能不一致的数据。
可用性和分区容忍系统(AP 系统)
AP 系统放松了一致性要求,允许在请求期间提供可能不一致的值。
CP 系统的一个例子是共识算法的实现,它要求多数派节点的参与才能进行:系统总是一
致的,但在网络分区的情况下可能不可用。而 AP 系统的一个例子是,只要有一个副本
活着,数据库就一定能进行读写,这最终可能导致数据丢失或返回不一致的结果。
PACELC 猜想 [ABADI12] 是 CAP 的一个扩展,它指出在网络分区(P)存在的情况下,
可用性和一致性(AC)之间存在一个选择。否则(Else, E),即使在没有网络分区的情况
下系统运行正常,我们
仍然
要在延迟(Latency, L)和一致性(C)之间做出选择。
11.2.1
小心使用
CAP
需要注意的是,CAP 讨论的是
网络分区
,而不是
节点崩溃
或任何其他类型的故障(如崩溃
恢复)。与集群其他节点分隔开的节点可以做出不一致的响应,但崩溃的节点根本不会响应。
一方面,这意味着没有必要考虑任何宕掉的节点需要面对一致性问题。而另一方面,现实
世界中的情况并非如此:还有许多不同的故障场景(其中一些可以用网络分区来模拟)。
CAP 意味着,即使所有节点都启动了,只要它们之间有连接性问题,我们仍可能面临一
致性问题。这是因为我们期望每个没有故障的节点都能正确响应,而不考虑有多少节点 ...
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