-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
501e8e0
commit 4b50320
Showing
4 changed files
with
16 additions
and
4 deletions.
There are no files selected for viewing
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,4 +1,4 @@ | ||
# 参考资料 | ||
# 其他资源 | ||
|
||
以下是一些有用的链接,可供进一步阅读: | ||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# CAP 定理 | ||
|
||
CAP 定理指出,分布式软件系统不可能同时满足以下三个特性中的超过两个(CAP):一致性(Consistency)、可用性(Availability)和分区容忍性(Partition Tolerance)。在设计分布式系统时,权衡 CAP 是我们首先需要考虑的问题。CAP 定理表明,在设计分布式系统时,我们只能在以下三个选项中选择其中两个: | ||
|
||
- **一致性(Consistency)**:所有节点在同一时间看到相同的数据。一致性通过在允许进一步读取之前更新多个节点来实现。 | ||
- **可用性(Availability)**:每个请求都会收到成功或失败的响应。可用性通过在不同服务器之间复制数据来实现。 | ||
- **分区容忍性(Partition Tolerance)**:即使发生消息丢失或部分故障,系统仍能继续运行。具备分区容忍性的系统可以承受任何不会导致整个网络失效的网络故障。数据在多个节点和网络组合中得到充分复制,以确保系统能够在间歇性故障期间保持正常运行。 | ||
|
||
 | ||
|
||
我们无法构建一个既持续可用、又满足顺序一致性,并且能够容忍任何分区故障的通用数据存储系统。我们只能构建一个在这三者中任选其二的系统。 | ||
|
||
这是因为,为了保证一致性,所有节点必须以相同的顺序看到相同的更新。但如果网络发生分区,某个分区中的更新可能无法及时传播到其他分区,而客户端可能会在读取最新数据后,又从过时的分区读取数据。应对这种情况的唯一办法是停止来自过时分区的请求服务,但这样一来,系统就不再是 100% 可用了。 |