---
title: "Short note: Zookeeper"
subject: "Big Data Technologies"
chapter: 6
key: "semester_8/big_data_technologies:short-note-zookeeper"
source: https://www.bctengineer.com/q/semester_8/big_data_technologies/short-note-zookeeper
site: BCT Engineering
---

# Short note: Zookeeper

Big Data Technologies · Chapter 6: Case Study: Hadoop

- Asked in: 2075 Bhadra, 5 marks
- Video: [ZooKeeper Explained in 5 Minutes](https://www.youtube.com/watch?v=iHrsHqSAe18) — TechPrep
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_8/big_data_technologies/short-note-zookeeper
- Whole chapter: https://www.bctengineer.com/md/semester_8/big_data_technologies/chapter-6

## Question

Write a short note on Zookeeper.

## Short answer

ZooKeeper is a centralized coordination service for distributed applications, storing data in a hierarchical namespace of znodes. An ensemble of servers elects a leader for writes and followers for reads, providing configuration, leader election, locks, and failure detection.

## Answer

**Apache ZooKeeper** is a centralized, open-source coordination service for distributed applications. It maintains configuration information and provides naming, distributed synchronization and group services, so that applications in a cluster (Hadoop, HBase, Kafka) do not need to implement these tricky tasks themselves.

#### Data model

ZooKeeper stores data in a hierarchical namespace, like a file system, made of **znodes**. Each znode holds a small amount of data (under 1 MB) and can have children. The types are persistent, ephemeral (deleted when the client session ends) and sequential. Clients can set **watches** to be notified when a znode changes.

#### Architecture

```text
          Clients
      /      |       \
  Server   Server   Server     <- ZooKeeper ensemble
(Follower) (Leader) (Follower)
```

An **ensemble** of an odd number of servers (3, 5, ...) replicates the data. One server is elected **leader** and handles all writes; the others are **followers**. Any server can serve reads, and followers forward writes to the leader. The service keeps working as long as a majority of servers is alive.

#### Services provided

- Configuration management
- Leader election
- Distributed locks and barriers
- Naming service and group membership (service discovery)
- Failure detection through ephemeral znodes

#### Role in Hadoop

HBase uses it to elect the active HMaster, track region servers and store the location of the META table. HDFS and YARN use it for automatic failover of the NameNode/ResourceManager in high-availability setups.

#### Properties

Sequential consistency, atomicity of updates, single system image, reliability and timeliness. It is very fast for read-heavy workloads.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. What problem does ZooKeeper solve?
   A. Storing petabytes of file data
   B. Converting SQL to MapReduce
   C. Providing centralized coordination such as configuration, naming, synchronization and group services for distributed applications
   D. Importing relational data
   Answer: C. It saves applications from implementing tricky coordination tasks themselves. (Key point: ZooKeeper purpose)

2. What is an ephemeral znode useful for?
   A. It is deleted when the client session ends, so it can detect failures
   B. It stores data permanently across sessions
   C. It holds large files above 1 MB
   D. It numbers znodes sequentially only
   Answer: A. Ephemeral znodes vanish when the client session ends, enabling failure detection and group membership. (Key point: Ephemeral znodes)

3. How is a ZooKeeper ensemble set up?
   A. An even number of servers, all handling writes
   B. A single server for simplicity
   C. An odd number of servers with one leader handling writes and followers serving reads, working while a majority is alive
   D. Servers that need all members alive to work
   Answer: C. An odd-sized ensemble with leader election keeps working as long as a majority survives. (Key point: Ensemble and majority)
