1、 Definition
CAP Theorem (CAPtheorem), It's also called brewer's theorem (Eric Brewer) , 1998 For the first time in .
It was originally proposed that distributed data storage cannot provide more than two of the following three guarantees at the same time :
Uniformity (Consistency): The information received each time is up-to-date .
Usability (Availability): Every request will receive ( Non error ) Respond to .
Partition fault tolerance (Partition tolerance): Although the network between nodes is not connected, resulting in zoning , The system is still running .
2、CAB Theorem practice
2.1 CP Strong consistency

Definition
Achieve consistency and partition fault tolerance , This combination is a data strong consistency pattern , That is, the data of multiple services must be consistent , At the expense of usability . Used in some scenarios that require high data consistency , For example, money related .
Middleware to achieve strong consistency includes zookeeper.
2.2 AP High availability

Definition
Meet availability and partition fault tolerance , Generally, the requirements for data consistency are not high . In case of failure , As long as not all nodes hang up , Then the cluster can still work normally .
Middleware for high availability Eureka, stay spring cloud It often appears as a registry in .