-
Notifications
You must be signed in to change notification settings - Fork 519
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
31 additions
and
84 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
# 6.5 小结 | ||
|
||
尽管 Paxos 是几十年前提出的算法,但它开创了分布式共识的研究,并提供了一种可验证的数学模型。 | ||
尽管 Paxos 是几十年前提出的算法,但它开创了分布式共识研究的先河。 | ||
|
||
Paxos 基于“少数服从多数”(Quorum 机制)原则,通过“请求阶段”、“批准阶段”在不确定环境下协商达成一致决策,解决了单个“提案”的共识问题。运行多次 Paxos 便可实现一系列“提案”共识,这正是 Multi-Paxos 的核心思想。Raft 在 Multi-Paxos 思想之上,以工程实用性为目标,在一致性、安全性和可理解性之间找到平衡,成为现代分布式系统,如 etcd、Consul、TiKV、MinIO 等等实现一致性的主流选择。 | ||
Paxos 基于“少数服从多数”(Quorum 机制)原则,通过“请求阶段”、“批准阶段”在不确定环境下协商达成一致决策,解决了单个“提案”的共识问题。运行多次 Paxos 便可实现一系列“提案”共识,这正是 Multi-Paxos 的核心思想。Raft 在 Multi-Paxos 思想之上,以工程实用性为目标,在一致性、安全性和可理解性之间找到平衡,成为分布式系统关键组件实现一致性的主流选择。 | ||
|
||
最后,再让我们思考一个问题,Raft 算法属于“强领导者”(Strong Leader)模型,领导者负责所有写入操作必限制整个 Raft 集群的写入性能,那如何突破 Raft 集群的写性能瓶颈呢? | ||
|
||
一种常见的方法是使用一致性哈希算法将数据划分为多个独立部分。例如,一个拥有 100TB 数据的系统,可以将数据分成 10 个部分,每部分只需处理 10TB。这种通过规则(如范围或哈希)将数据分散到不同部分进行处理的策略,被称为“分区机制”(Partitioning)。分区机制广泛应用于 Prometheus、Elasticsearch 、ClickHouse 等大数据系统(详见本书第九章)。理论上,只要机器数量足够,分区机制便能够支持几乎无限规模的数据处理。 | ||
一种方法是使用一致性哈希算法将数据划分为多个独立部分。例如,一个拥有 100TB 数据的系统,可以将数据分成 10 个部分,每部分只需处理 10TB。这种通过规则(如范围或哈希)将数据分散到不同部分进行处理的策略,被称为“分区机制”(Partitioning)。分区机制广泛应用于 Prometheus、Elasticsearch 、ClickHouse 等大数据系统(详见本书第九章)。理论上,只要机器数量足够,分区机制便能够支持几乎无限规模的数据处理。 | ||
|
||
解决了数据规模的问题,接下来的课题是“将请求均匀地分摊至各个分区”,这部分内容我们在下一章《负载均衡》展开讨论。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.