Database Reference
In-Depth Information
Apache ZooKeeper
Building a distributed application requires the management of several nodes and processes
working together at the same time. Synchronization and coordination of the nodes is the
primary responsibility of any distributed application. As this is a common requirement for
many distributed applications, having a common framework to achieve this has been the
primary focus of the open source community in the distributed computing space.
Apache ZooKeeper is a distributed coordination service. It is a framework that can be used
to build distributed applications by providing a set of services such as a name service, lock-
ing, synchronization, configuration management, and leader election services. These ser-
vices are explained as follows:
Name service : A name service in a distributed systems scenario would be the
names and statuses of all the nodes and services in a cluster. ZooKeeper has an in-
built mechanism that performs the functions of a name service.
Locking : Often, services in a distributed system will access a single resource at the
same time. Locking of the resources allows the sharing of common resources effi-
ciently. ZooKeeper provides a mechanism to lock resources.
Synchronization : ZooKeeper provides a very efficient way of synchronizing ac-
cess to shared resources on the cluster.
Configuration management : Having a central location for all configuration-re-
lated information for nodes in a cluster makes it easy to manage the cluster effi-
ciently. All modifications to the configuration can be done once at the central loca-
tion, and the changes will be propagated to all nodes in the cluster. Also, when new
nodes are added to the cluster, the configuration can be pulled from the central loc-
ation.
Leader election : Distributed systems are prone to failures whereby nodes crash or
fail abruptly. To overcome major cluster downtime, distributed applications usually
set up failover nodes for the nodes that could be the single point of failure.
ZooKeeper implements the technique of leader election, which works perfectly for
such scenarios.
ZooKeeper maintains all its data in a hierarchical structure, just like a traditional filesys-
tem. Each data register (a unit of storage of information) in ZooKeeper is called a znode
(ZooKeeper node).
A typical ZooKeeper service comprises a set of servers that are used for the replication of
information. These multiple servers ( ensemble ) allow ZooKeeper to be highly available,
Search WWH ::




Custom Search