If you want a highly carrier-oriented husband, he most likely couldn’t pay much attention and time to his family. If you drive a car with complex high techs, high performance, and luxury, it most likely won’t come with reliability. There are many imperfections in many aspects of the real world. Like these imperfections, the CAP theorem is the theory of you can’t have all.
Despite many imperfections, it boils down to one question, what are the most important factors that we want the most.
I am going to explain the CAP theorem with simple language with real world examples.
The C — Consistency
The consistency means in the same software system having the same state of data in different storage spaces at the same time.
Once you commit it, it should have the same result when you query later no matter when and where you check it.
Take the ATM machine as an example, if you withdrew $1,000,000 from your account, once the transaction has done, no matter when and where you check it, there must be $1,000,000 amount deduction from your account balancer. There’s no tolerance for any delay of account balance synchronisation in this scenario, otherwise, you can earn $1,000,000 easily by having two people in different locations with the distance that is long enough for the system delay to withdraw $1,000,000 at the same time even your account doesn’t have $2,000,000.
The A — Availability
The availability means at the same time the service is available.
The availability refers to whether services are available, in the other word, whether a service can response in a reasonable manner with reasonable response.
If we initial a phone call to a friend, and the call is successfully initiated. However, the delay of our voice to the other party is 500 years, then the service is still unavailable. We would simply hang up the call.
The P — Partition Tolerance
The partition means in different storage spaces.
Partitions tolerance means the distributed system still provide services even part of the system is unavailable due to some issues such as network unavailability.
Take a news system as an example,

As can be seen from the above diagram, the Brisbane server is still able to provide service for Users with cached/stored relatively old data in its data source. This is an example of the AP model.
The Conflicts
CP(Consistency and Partition Tolerance)
To have same state of data in different storage spaces, it must be at the different time.
AP(Availability and Partition Tolerance)
At any time, to be able to get data from storage in any space, there must be instances that the data is inconsistent.
CA(Consistency and Availability)
At any time, to be able to get the consistent data from any storage space, then there must be only 1 storage space.
For the current human technology, it is impossible to achieve CAP at the same time.
Usage
Strong consistency scenarios: Bank transaction
To be strong consistency, we need synchronisation when update occur, and the performance and availability will severely impact.
High availability scenarios: articles, news websites.
For high availability scenarios, we can apply eventually consistency model. Users might get some old data for a certain period, but eventually they will have the new data.
Applications
Zookeeper(ZK)
ZK applies the CP model. At any time, we can have consistent data results. It has network partition tolerance but doesn’t guarantee the availability of services. For example, if the ZK cluster is busy with elections or half of the machines are unavailable in the cluster, then the service is unavailable.
Eureka
Eureka applies the AP model. It does not guarantee the consistency of data. Further detail please refer to my previous post: Spring Cloud Netflix Eureka for microservice registration and discovery