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 .



![[fundamentals of image processing] GUI image histogram equalization system based on MATLAB [including Matlab source code 1924]](/img/8a/f5847eef7318f3db54aa2d4405b06a.jpg)





![[Old Wei makes machines] issue 090: keyboard? host? Full function keyboard host!](/img/78/ece6da9a26c9d93988dac30ce93f99.png)