What are A and P in CAP and the difference between them?

Technology CommunityCategory: CAP TheoremWhat are A and P in CAP and the difference between them?
VietMX Staff asked 3 years ago
Problem

I get a feeling that A and P can go together (I know this is not the case, and that’s why I fail to understand!). Explaining in simple terms, what are A and P and the difference between them?

  • Consistency means that data is the same across the cluster, so you can read or write from/to any node and get the same data.
  • Availability means the ability to access the cluster even if a node in the cluster goes down.
  • Partition tolerance means that the cluster continues to function even if there is a “partition” (communication break) between two nodes (both nodes are up, but can’t communicate).

If you have both availability (the cluster doesn’t go down) and partition tolerance (the database can survive nodes being unable to communicate), then you can’t guarantee that all nodes will always have all the data (consistency), because nodes are up and accepting writes, but can’t communicate those writes to each other.