Files
chill_notes/实践积累/数据库/CAP定理(CAP theorem).md
2026-04-21 17:41:25 +08:00

15 lines
1.3 KiB
Markdown
Executable File
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
==在计算机科学中, CAP定理CAP theorem, 又被称作 布鲁尔定理Brewer's theorem, 它指出对于一个分布式计算系统来说,不可能同时满足以下三点:==
- **一致性(Consistency)** ==(所有节点在同一时间具有相同的数据)==
- **可用性(Availability)** ==(保证每个请求不管成功或者失败都有响应)==
- **分隔容忍(Partition tolerance)** ==(系统中任意信息的丢失或失败不会影响系统的继续运作)==
==CAP理论的核心是一个分布式系统不可能同时很好的满足一致性可用性和分区容错性这三个需求最多只能同时较好的满足两个。==
==因此,根据 CAP 原理将 NoSQL 数据库分成了满足 CA 原则、满足 CP 原则和满足 AP 原则三 大类:==
- ==CA - 单点集群,满足一致性,可用性的系统,通常在可扩展性上不太强大。==
- ==CP - 满足一致性,分区容忍性的系统,通常性能不是特别高。==
- ==AP - 满足可用性,分区容忍性的系统,通常可能对一致性要求低一些。==
![captheoramimage](Exported%20image%2020260407225428-0.png)
> 来自 <[http://www.runoob.com/mongodb/nosql.html](http://www.runoob.com/mongodb/nosql.html)>
> 来自 <[http://www.runoob.com/mongodb/nosql.html](http://www.runoob.com/mongodb/nosql.html)>