CAP theory: C: Here C refers to the strong consistency, the data version obtained by different clients at the same time is the same A: Availability, which means that the system will respond to every request from the client, P: partition tolerance, which means that the system can still work properly when one node in the system is disconnected from other nodes (resulting in data inconsistency between nodes)

Internet application P must be guaranteed, but why can’t both A and P be satisfied? To ensure strong consistency, data synchronization is required when data inconsistency occurs on system nodes. During this period, the system cannot guarantee strong consistency. Therefore, if a request is sent to Node1 node during data synchronization, The system will tell the client that the system is unavailable and please try again later. Of course, the system can also return the old version data on Node1 to the client (final consistency,Base theory).

Take an AP example: a user sets up a new profile picture on Node1, and then looks at his profile picture on Node2.

An example of CP: the user recharges 100 yuan on Node1, then checks the balance on Node2, and if there is no synchronization between the time nodes, the service will be told to retry.

CP: Redis, ZooKeeper (final consistency or strong consistency?) AP: euraka,

Protocols on the Raft can take a look at this article www.cnblogs.com/mindwind/p/…