CAP theory and BASE theory of distributed systems

1. CAP theory

  • Consistency: If the data of any node is successfully modified, all other nodes can read the latest value, then the system is considered to have strict consistency.
  • Availability (availability): Every request can get a non-error response, that is, a single node downtime can get a response from other nodes, but it cannot guarantee that the obtained data is the latest data, that is, it is mutually exclusive with consistency.
  • Partition tolerance: When any number of message losses or high latency occurs between nodes, the system can still provide services.

Any distributed system can only choose two out of three, that is, only AP or CP, and must have P.

2. BASE theory

 Basically Available and Eventually Consistency (Eventually consistent)

Basic availability: When a distributed system fails, it is allowed to lose the availability of some functions to ensure the availability of core functions. To put it bluntly, it is a service downgrade. When the service pressure is too high, suspend the use of some non-core businesses.

Final consistency: All data in the system can finally reach a consistent state after a period of synchronization. That is to say, there is a short delay in data consistency.

Guess you like

Origin blog.csdn.net/u012758488/article/details/130231500