As the cornerstone of opening a distributed architecture, there must be other options besides
Some of my own understanding, if there is a mistake, please be sure to correct it!
1. What is it?
A solution for distributed data consistency.
2. What is the use
Data publishing /subscription (configuration center) , load balancing ( dubbo uses the zookeeper mechanism to achieve load balancing) , naming service,
Master election (kafka, hadoop, hbase), distributed queue, distributed lock.
Introduction to zookeeper
1. CAP theory and BASE theory
References: http://www.jdon.com/bigdata/how-to-understand-cap.html
● Consistency (C): Whether all data backups in distributed systems have the same value at the same time. (equivalent to all nodes accessing the same latest copy of data)
EPHEMERAL (temporary node, service disconnection, node disappears)
EPHEMERAL_SEQUENTIAL (temporary ordered node)
Transaction requests (additions, deletions, and modifications) initiated from the same client will eventually be applied to zookeeper in strict order (queue, fifo)
3,2 atomicity
The application of the processing results of all transaction requests on all machines in the entire cluster is consistent, that is, either all machines in the entire cluster have successfully applied a certain transaction,
or don't apply at all
3.3 Be more reliable
Once the server successfully applies a transaction data and responds to the client, the data must be synchronized and preserved throughout the cluster
3.4 Real-time
Once a transaction is successfully applied, the client can immediately read the latest data status after the transaction has been changed from the server; ( zookeeper only guarantees near real-time within a certain period of time)