1

I have read the wiki, and I understand sentences explaining the Consistency Availability and Partition tolerance but grasping CAP/Brewer's theorem is like holding a fish.

I believe there exist a better intuitive way explaining and understanding CAP theorem.

Any good text ?

{ Before someone think question formed as Plain-English-Explanation are nonconstructive, here is a list of all other great Plain-English-Explanations question.

What is a plain English explanation of "Big O" notation?

Ukkonen's suffix tree algorithm in plain English?

What is SOA "in plain english"?

Can you explain what "git reset" does in plain english?

}

Community
  • 1
  • 1
Ajeet Ganga
  • 8,353
  • 10
  • 56
  • 79
  • [Please stop calling databases CP or AP](https://martin.kleppmann.com/2015/05/11/please-stop-calling-databases-cp-or-ap.html) contains an explanation – miracle173 May 04 '17 at 06:08

2 Answers2

3

CAP theorem says that in case of Network Partition(P) in a distributed data store, one needs to sacrifice either Consistency(C) or Availability(A).

The two out of three terminology (CA/CP/AP) often used is confusing as it seems that each of C, A and P are some characteristics of a system but P actually is a situation which forces to pick only one of the characteristics out of C and A.

nkr
  • 118
  • 1
  • 8
0

In my understanding

CAP theorem is acronym for:

  • Consistency: see the most recent data without a delay
  • availability: system should give a response to every request
  • partitioning: means distributing your data in different location.

CAP theorem says you can not achieve 3 of them. you should stick with two and sacrifice one!

Lets see why!

1- If you need consistency and availability. You should forget partitioning because as you partition there is a slight window of opportunity that nodes lag behind the recent data.

2- If availability and partitioning is the goal you have to pay the cost of consistency as explained in 1.

3- finally if you choose partitioning and consistency you should sacrifice availability to handle lags of deferent nodes to have recent data.

see the picture below for different database vendors in this theorem. enter image description here

picture from http://www.abramsimon.com

Morteza Adi
  • 2,413
  • 2
  • 22
  • 37
  • 2
    Brewer made it explicit that it is misconception that you can do with two and not have third. You can't have a distributed (multinode) DB that is truly partition tolerant. – Ajeet Ganga Jul 27 '15 at 22:28
  • You are wrong it explicitly states that it is impossible for a distributed computer system to simultaneously provide all three of them! – Morteza Adi Jul 28 '15 at 02:29
  • follow the link and listen Cap definition from Brewer himself http://www.se-radio.net/2015/05/the-cap-theorem-then-and-now/ – Morteza Adi Jul 28 '15 at 02:30
  • Let me restate better. Brewer talks about the trade offs and not about a binary world where one has to choose from AP vs CP. – Ajeet Ganga Feb 15 '22 at 11:50
  • RDBMS are not available in case cluster nodes have a network partition between them. There is no such class of systems as CA. RDBMS choose Consistency and therefore in case of network partition are not available. The "choose 2 of three" view of CAP theorem is wrong, as explained above. – mvmn Apr 01 '23 at 22:07