How CA distributed system according to Cap Theorem can exist

末鹿安然 提交于 2020-07-02 18:31:45

问题


How can a distributed system be consistent and available - CA. Because when partition happens CA is not possible. And if we say partition wont happen then only they are CA, then all systems which are CP or AP will also be CA in case partition wont happen?


回答1:


A little late answer, sorry:

It can't.

As often mentioned, the CAP theorem in its original form is a little misleading. It can be restated as

in the presence of the network partition, a distributed system is either available or consistent

so you are right. Generally systems cannot be classified as CA, CP or AP only, since partition tolerance is a property of the system, which describes what to choose in case of a network partition. So it is possible that a system can behave according to AP sometimes, and CP other times (however it is not common).

Another interesting part is that RDBMS databases are often at the CA side of the triangle. This is only the case in a single node setup. Even with master (write) - slave (read) setup, the system is not CA (or if it is CA, then a split-bran scenario may happen, a new master is elected for the partition, etc...).

Useful read: https://codahale.com/you-cant-sacrifice-partition-tolerance/.




回答2:


Dr. Stonebraker says: The guidance from the CAP theorem is that you must choose either A or C, when a network partition is present. As is obvious in the real world, it is possible to achieve both C and A in this failure mode.

See this for thoughts on why CA can exist:

CA is a specification of the operating range: you specify that the system does not work well under partition or, more precisely, that partitions are outside the operating range of the system.

My background is far from these theoretical considerations and I must say it is highly confusing. I am researching distributed Blockchain systems and I don't see why those "generalized" definitions of C, A, P must always apply. If let's say 5% of nodes fail or are otherwise partitioned, the consensus still functions. If an end user is connected to a partitioned node, the node could let the user know it lost connection. I don't even see how any major Blockchain network is CP without defining conditions such as "if a certain amount of nodes fail or get partitioned, the consensus halts".



来源:https://stackoverflow.com/questions/47539213/how-ca-distributed-system-according-to-cap-theorem-can-exist

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!