For more information, please see the zookeeper website.
Zookper: A collaborative service for distributed applications
Zookper is a distributed, open-source, collaborative service for distributed applications. It provides simple operations that enable distributed applications to implement services such as synchronization, configuration maintenance, and sub-clusters or naming based on these interfaces. The zookper is very easy to access programmatically, and it uses a data model similar to the file tree structure. You can use Java or C for programmatic access.
As we all know, distributed system Collaboration service is difficult to have satisfying products. These collaborative services products can easily fall into the trap of competing selection conditions or deadlocks. The purpose of Zookper is to make distributed services no longer required for collaborative services due to collaboration conflicts.
The design goal zookeeper is simple
Zookeeper enables distributed processes to work together through a hierarchical namespace that resembles a file system. These namespaces consist of a series of data registers, which we also call the data registers as znodes. These znodes are a bit like files and folders in the file system. Unlike file systems, file system files are stored on storage, and zookeeper data is stored in memory. At the same time, this means that the zookeeper has high throughput and low latency.
The zookeeper enables high performance, high reliability, and orderly access. High performance ensures that the zookeeper can be applied to large distributed systems. High reliability ensures that it does not cause any problems due to a single node failure. An orderly access ensures that the client can achieve more complex synchronization operations.
zookeeper can be reused.
ZooKeeper Service
Each server that makes up the zookeeper must be able to communicate with each other. They saved the server state in memory, saved the log of the operation, and persisted the snapshot. As long as most of the servers are available, then zookeeper is available.
The client connects to a zookeeper server and maintains a TCP connection. and sends the request, gets the reply, gets the event, and sends the connection signal. If the TCP connection is broken, the client can connect to another server.
zookeeper is orderly.
Zookeeper uses numbers to mark each update. This ensures an orderly zookeeper interaction. Subsequent operations can implement a higher and more abstract service, such as synchronous operations, based on this order.
zookeeper is efficient.
Zookeeper is more efficient in reading-based systems. The zookeeper can perform well on a distributed system consisting of approximately 10:1 read and write ratios of thousands of servers.
data structures and hierarchical namespaces
The zookeeper namespace is structured like a file system. A name is the same as the file used/path representation, each node of the zookeeper is uniquely identified by the path
ZooKeeper ' s hierarchical Namespace
Implement
Shows the advanced Component Services for the Zookeeper service. In addition to the request processor, each server in the Zookeeper server group replicates each of their own components.
ZooKeeper components
Replicated database is a structure that is stored in memory that contains the entire data tree. All update operations are logged to the hard disk. And the write operation is serialized and stored on the hard disk when it acts on the database.
A number of clients are connected to each zookeeper server. The client connects to a server to submit the request.