分布式系统的CAP原理

分布式系统的CAP原理

CAP原理的定义

分布式系统无法同时确保一致性(Consistency)、可用性(Availability)和分区容忍性(Partition Tolerance)

① The CAP principle, also known as CAP theorem, refers to Consistency, Availability and Partition tolerance in a distributed system. The CAP principle means that the three elements can achieve at most two at the same time, not all three.

具体含义如下:
一致性(Consistency):任何事务应该都是原子的,所有副本上的状态都是事务成功提交后的结果,并保持强一致;
可用性(Availability):系统(非失败节点)能在有限时间内完成对操作请求的应答;
分区容忍性(Partition Tolerance):系统中的网络可能发生分区故障(成为多个子网,甚至出现节点上线和下线),即节点之间的通信无法保障。而网络故障不应该影响到系统正常服务。

CAP原理认为,分布式系统最多只能保证三项特性中的两项。
且由于目前的网络通讯情况,延迟丢包、网络中断,或其他一些不可抗力导致网络失效等问题,分区容忍性在一般情况下是一定要满足的,一般会在一致性和可用性之间权衡选择一方。

猜你喜欢

转载自blog.csdn.net/William__Ma/article/details/128946875
今日推荐