- Consistency (all nodes see the same data at the same time)
- Availability (a guarantee that every request receives a response about whether it was successful or failed)
- Partition tolerance (the system continues to operate despite arbitrary message loss or failure of part of the system)
以上是wiki上的定义。最后那个P我一直理解错了,今天才知道原来是容分割⋯⋯也就是说如果系统中的一部分故障了或者说被分割成两个不能互相通信的部分,系统仍然能继续工作。
三者之中只能保证两个。
wiki上补充道:有的时候三选二的理解可能是错误的。
1.partition在某些系统中并不常见。在这种情况下放弃C或者A都是不明智的。
2.CAP都不是01变量,而是连续变量。A不必说,C也是有很多的不同的level的。
3.在同一个系统中的不同状态中,C和A有可能是在变化的。在一个大系统的子系统中,它们对C和A的选择也可能有所不同。
CAP中的C和ACID中的C的概念也不同。
关于如何增加Availability,Harvest, Yield and Scalable Tolerant Systems这篇paper提出一是加replica..二是将系统分解为若干正交子系统,这样当部分系统fail时整体仍然工作。其实是很常用的做法了。SOA嘛。。
Read full article from CAP定理 « Ashes of Time
No comments:
Post a Comment