Search code examples
distributedpartitionconsistencyavailability

What if we partition a C+A distributed system?


I've read this, this and this but still cannot understand the C+A category of the CAP theorem.

I mean those system are not design to support partition that might occur. Eventually they can deal with the loss of some isolated nodes if there are replica around.

Right, but I can see some of them do exist. So, in the real world, how do they behave if we partition the nodes ? Live nodes in both partitions have to choose beetween A and C... or do they lose both ?


Solution

  • You can't have a C+A distributed system, that's the whole point of the CAP theorem. As explained here for instance, and I quote:

    CAP prohibits only a tiny part of the design space: perfect availability and consistency in the presence of partitions, which are rare.

    Although designers still need to choose between consistency and availability when partitions are present, there is an incredible range of flexibility for handling partitions and recovering from them.

    If you want to simplify the CAP theorem into a short sentence (such as "you get to pick 2 out of 3") a better approximation would be:

    In the presence of a partition, you get to pick consistency or availability.