关于CAP理论的初了解

C (Consistency),一致性: all nodes see the same data at the same time(所有节点在同一时刻看到的数据都是相同的);又称为原子性或事务一致性,要求一个事务的所有操作要么全部提交成功,如果有一个操作失败,则整个事务失败;
 
A (Availability),可用性: a guarantee that every request receives a response about whether it was successful or failed,要能够保证每一个请求都能够接收到本次操作成功或失败的响应;通常都需要通过分布式数据冗余,负载均衡等等技术来确保可用性;
 
P (Partition tolerance):分区容忍性: the system continues to operate despite arbitrary message loss or failure of part of the system ;一般对于分布式系统来说,分区容忍性是基本要求。
 
CAP 原理就是指这三个要素最多只能同时满足其中的亮点。而根据上面说的在一个分布式系统中,分区容忍性一般是基本要求,因此剩余的就只能在 一致性 与 可用性 之间进行平衡。
 
下图给出了针对不同的权衡而可选择的方案:
 
关于 CAP 理论的初了解
 
参考资料:
 
     http://en.wikipedia.org/wiki/CAP_theorem 
     http://www.julianbrowne.com/article/viewer/brewers-cap-theorem 

网页名称:关于CAP理论的初了解
网站地址:http://pwwzsj.com/article/psgpog.html