0

I've read many articles about CAP theorem. I understand what A,C,P means, and what can we do when we have network communication problems.

In conclusion we have such cases:

If two nodes have communication problem in cluster:

  1. At this moment , when problem occurs, we can allow the nodes to be out of sync (give up consistency), or

  2. At this moment , when problem occurs, disable the nodes for a while (give up availability - disable read/write from the nodes where was communication problem detected).

Using this we have such cases:

1) CA - if communication problem occurs, data is out of sync, because we have "Availability" and we do not disable the nodes which have problem. But sync will be started communication will be resolved.

2) CP - if communication problem occurs, node will be disabled (write/read cant be done to this node)

3) AP - if communication problem occurs, data is out of sync too. But because of we do not have C, we do not have guarantee that data will be same after sync.

AP is not clear for me, why we do not have guarantee that data will be same after sync? I know because of CAP theorem tells us this and because we do not have C but... this is not enough , this does not tells us what happens really inside out, technologically...

Community
  • 1
  • 1
grep
  • 5,465
  • 12
  • 60
  • 112
  • 1
    This is kind of a broad question because it depends on the implementation. Cassandra for example uses [read repair](http://wiki.apache.org/cassandra/ReadRepair). Brewer also talked about recovery in general [here](http://www.infoq.com/articles/cap-twelve-years-later-how-the-rules-have-changed) (see "Partition recovery" and on) – LMeyer Oct 08 '14 at 14:58
  • At the moment, is there any DB which have CP and AP too? – grep Oct 08 '14 at 15:06
  • See my anwser on another [question](http://stackoverflow.com/questions/16779348/does-the-cap-theorem-imply-that-acid-is-not-possible-for-distributed-databases/16779594#16779594). However, some would say Google Spanner but we're not Google so... – LMeyer Oct 08 '14 at 15:12
  • possible duplicate of [NoSQL CAP theorem - Availability and Partition Tolerance](http://stackoverflow.com/questions/12346326/nosql-cap-theorem-availability-and-partition-tolerance) – Ankur Choudhary May 24 '15 at 08:57
  • A brilliant answer on similar question [here][1]. Hope it helps. [1]: http://stackoverflow.com/questions/12346326/nosql-cap-theorem-availability-and-partition-tolerance – Ankur Choudhary May 24 '15 at 08:58

1 Answers1

0

AP basically means that system will keep on taking updates. Let's say updates are being sent to server S1 which is partitioned from server S2. S1 will be able to serve new values but S2 will still show stale values. Although, CAP theorem doesn't talk about convergence once partition is gone, there are lot of ways to build systems post network partition. We can use CRDTs(Conflict Free Replicated DataTypes) or we can also use Compensating Transactions. Eric Brewer has written about this in the following paper - CAP 12 Years