SlideShare a Scribd company logo
Binu George
www.globinch.com
www.java.globinch.com
Agenda
 Coordination headache in distributed applications
 What is zookeeper?
 Zookeeper Overview
 Zookeeper Service & Data Model
 ZAB (Zookeeper Atomic Broadcasting Protocol)
 Zookeeper Read, Write and Watch
 Zookeeper Use Cases
 Zookeeper Client API Example
Coordination headache in distributed
applications
 Problem of Detection
 Cluster Size Estimation
 Leader Election
 Group Membership
 Configuration Management
 Consensus among multiple parties is difficult in
dynamic distributed systems as members may
leave/fail/join anytime
 Consistency, Availability and Partition tolerance
What is Zookeeper?
 Apache Zookeeper is a highly consistent, scalable and
reliable cluster co-ordination service.
 Zookeeper is a CP system where Consistency and
Partition tolerance are guaranteed.
 Off-the-shelf support for implementing consensus,
group management, leader election etc.
 Zookeeper cluster is called Ensemble
 Ensemble has one leader and remaining followers
 Zookeeper is a Distributed Coordination Service for
Distributed Applications.
 Zookeeper is originally developed by Yahoo research
Team and became a top level Apache project.
Zookeeper is used by many enterprises including
Rackspace, Yahoo! and eBay.
Zookeeper Overview
 Zookeeper use Zookeeper Broadcasting Protocol (ZAB) for
ordering and integrity.
 Achieves High availability and performance via replication.
 Low latency and high throughput via in memory image of
data tree ,transaction logs and snapshots.
 Uses “quorum” model and will only be available if a
majority of servers are alive (by a strict majority of nodes).
 Zookeeper relies on a quorum for durability as well.
 Pipelined architecture of Zookeeper enables the execution
of operations from a single client in FIFO order.
 Ordered updates uses ZAB protocol (a leader-based atomic
broadcast protocol) for Ordering, Integrity , exactly once.
 Election of a new leader is followed by a synchronization
phase before any new changes are accepted.
Zookeeper Service & Data Model
 At any given time, one Zookeeper client is connected
to one Zookeeper server.
 If the node (to which client connected) fails, client
automatically connect to another server in ensemble
with transparent session transfer.
 Znode is an in-memory data node in Zookeeper Data
organized in a hierarchical namespace (data tree)
 The data model of ZooKeeper (znode) is essentially a
file system with a simplified API and associated meta
data and versions.
 Regular, Ephemeral and Sequential Znode are
supported.
 Each ZNode is using UNIX style notation. For
example, /A/B/C to denote the path to znode C, where
C has B as its parent and B has A as its parent.
 All znodes store data, and all znodes, except for
ephemeral znodes, can have children.
Zookeeper read/write/watch
 Clients make use of Zookeeper API to update/write
Zookeeper the data tree.
 All Updates are ordered and managed by leader with
unique zxid and are considered complete when a
quorum confirms the update.
 The leader executes update request and broadcasts
the change to the ZooKeeper state through Zab.
 Zab by default uses a simple majority quorums to
decide on a proposal.
 Read and Watch requests on the znode sent by a client
to a ZooKeeper server are processed locally.
 Watch –Allows client to get notification if an already
returned information gets updated.
Zookeeper read/write/watch
Zookeeper read/write/watch
 Read and Watch requests on the znode are
processed locally but, write requests are
propagated to leader server and go through a
consensus before a response is generated.
 Throughput of read request increases with
number of servers and throughput of write
requests, decreases with number of servers.
Zookeeper use cases
 ZooKeeper offers the library to create and manage
synchronization primitives.
 ZooKeeper avoids the single-point-of-failure. Typical
use cases ,
 Naming service
 Configuration management
 Synchronization
 Leader election
 Message Queue
 Notification system
Zookeeper Java Client API Examples
 A simple example.
 To check the complete example see at the below link.
 http://java.globinch.com/enterprise-
services/zookeeper/apache-zookeeper-explained-
tutorial-cases-zookeeper-java-api-examples/

More Related Content

What's hot (20)

PPTX
Replication Techniques for Distributed Database Design
Meghaj Mallick
 
PPTX
Zookeeper big sonata
Anh Le
 
PDF
Apache Nifi Crash Course
DataWorks Summit
 
PDF
Intro to HBase
alexbaranau
 
PPTX
Slide #1:Introduction to Apache Storm
Md. Shamsur Rahim
 
PDF
Nifi workshop
Yifeng Jiang
 
PDF
RabbitMQ vs Apache Kafka - Part 1
Erlang Solutions
 
PPTX
Apache Spark Architecture
Alexey Grishchenko
 
PPTX
Data Stream Processing with Apache Flink
Fabian Hueske
 
PDF
Apache Kafka
Worapol Alex Pongpech, PhD
 
PDF
Traitement distribue en BIg Data - KAFKA Broker and Kafka Streams
ENSET, Université Hassan II Casablanca
 
PDF
Designing Apache Hudi for Incremental Processing With Vinoth Chandar and Etha...
HostedbyConfluent
 
PDF
A Closer Look at Apache Kudu
Andriy Zabavskyy
 
PPTX
Stream Processing Frameworks
SirKetchup
 
PDF
Spark (v1.3) - Présentation (Français)
Alexis Seigneurin
 
PPTX
HBase Low Latency
DataWorks Summit
 
PDF
Introduction to Apache NiFi dws19 DWS - DC 2019
Timothy Spann
 
PDF
Apache kafka
NexThoughts Technologies
 
PDF
Apache Spark with Scala
Fernando Rodriguez
 
PDF
Best Practices for Streaming IoT Data with MQTT and Apache Kafka
Kai Wähner
 
Replication Techniques for Distributed Database Design
Meghaj Mallick
 
Zookeeper big sonata
Anh Le
 
Apache Nifi Crash Course
DataWorks Summit
 
Intro to HBase
alexbaranau
 
Slide #1:Introduction to Apache Storm
Md. Shamsur Rahim
 
Nifi workshop
Yifeng Jiang
 
RabbitMQ vs Apache Kafka - Part 1
Erlang Solutions
 
Apache Spark Architecture
Alexey Grishchenko
 
Data Stream Processing with Apache Flink
Fabian Hueske
 
Traitement distribue en BIg Data - KAFKA Broker and Kafka Streams
ENSET, Université Hassan II Casablanca
 
Designing Apache Hudi for Incremental Processing With Vinoth Chandar and Etha...
HostedbyConfluent
 
A Closer Look at Apache Kudu
Andriy Zabavskyy
 
Stream Processing Frameworks
SirKetchup
 
Spark (v1.3) - Présentation (Français)
Alexis Seigneurin
 
HBase Low Latency
DataWorks Summit
 
Introduction to Apache NiFi dws19 DWS - DC 2019
Timothy Spann
 
Apache Spark with Scala
Fernando Rodriguez
 
Best Practices for Streaming IoT Data with MQTT and Apache Kafka
Kai Wähner
 

Viewers also liked (20)

PDF
Apache ZooKeeper
Scott Leberknight
 
PPTX
Distributed Applications with Apache Zookeeper
Alex Ehrnschwender
 
PDF
Introduction to ZooKeeper - TriHUG May 22, 2012
mumrah
 
PDF
Zookeeper In Simple Words
Fuqiang Wang
 
PPTX
Introduction to Kafka and Zookeeper
Rahul Jain
 
PPTX
So we're running Apache ZooKeeper. Now What? By Camille Fournier
Hakka Labs
 
PDF
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
mumrah
 
PPTX
GAME 3400 Level Design - Experience Architecture
Seth Sivak
 
PDF
Kaazing Gateway + Apache Active MQ + Javascript + Stomp
Irontec
 
PDF
Zookeeper: Wait-free Coordination for Internet-scale Systems
Leandro Lera Romero
 
PPTX
2017-01-26 Internet Arriskuak: Andramendi Ikastola, Gurasoen saioa
Urko Zurutuza
 
PDF
Monitorización
Miguel Angel Nieto
 
PPTX
Strata + Hadoop World 2012: HDFS: Now and Future
Cloudera, Inc.
 
PDF
Conferencia 2: El esquema
Jorge Luis Betancourt Gonzalez
 
PDF
Replicación Mysql
Miguel Angel Nieto
 
PDF
Mysql Administracion
Miguel Angel Nieto
 
PDF
使用ZooKeeper打造軟體式負載平衡
Lawrence Huang
 
PDF
¿Cómo se despliega y autoescala Couchbase en Cloud? ¡Aprende de manera práctica!
Paradigma Digital
 
PPTX
Hadoop: MapReduce para procesar grandes cantidades de datos
Raul Ochoa
 
PDF
Introduction to Terracotta
Cris Holdorph
 
Apache ZooKeeper
Scott Leberknight
 
Distributed Applications with Apache Zookeeper
Alex Ehrnschwender
 
Introduction to ZooKeeper - TriHUG May 22, 2012
mumrah
 
Zookeeper In Simple Words
Fuqiang Wang
 
Introduction to Kafka and Zookeeper
Rahul Jain
 
So we're running Apache ZooKeeper. Now What? By Camille Fournier
Hakka Labs
 
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
mumrah
 
GAME 3400 Level Design - Experience Architecture
Seth Sivak
 
Kaazing Gateway + Apache Active MQ + Javascript + Stomp
Irontec
 
Zookeeper: Wait-free Coordination for Internet-scale Systems
Leandro Lera Romero
 
2017-01-26 Internet Arriskuak: Andramendi Ikastola, Gurasoen saioa
Urko Zurutuza
 
Monitorización
Miguel Angel Nieto
 
Strata + Hadoop World 2012: HDFS: Now and Future
Cloudera, Inc.
 
Conferencia 2: El esquema
Jorge Luis Betancourt Gonzalez
 
Replicación Mysql
Miguel Angel Nieto
 
Mysql Administracion
Miguel Angel Nieto
 
使用ZooKeeper打造軟體式負載平衡
Lawrence Huang
 
¿Cómo se despliega y autoescala Couchbase en Cloud? ¡Aprende de manera práctica!
Paradigma Digital
 
Hadoop: MapReduce para procesar grandes cantidades de datos
Raul Ochoa
 
Introduction to Terracotta
Cris Holdorph
 
Ad

Similar to Apache Zookeeper Explained: Tutorial, Use Cases and Zookeeper Java API Examples (20)

PPTX
Zookeeper Tutorial for beginners
jeetendra mandal
 
PPTX
Leo's Notes about Apache Kafka
Léopold Gault
 
PPTX
Meetup on Apache Zookeeper
Anshul Patel
 
PPTX
Winter is coming? Not if ZooKeeper is there!
Joydeep Banik Roy
 
PPTX
Apache zookeeper seminar_trinh_viet_dung_03_2016
Viet-Dung TRINH
 
PDF
Tech Talks_25.04.15_Session 3_Tibor Sulyan_Distributed coordination with zook...
EPAM_Systems_Bulgaria
 
PPTX
Zookeeper Architecture
Prasad Wali
 
PPTX
ZeroMq ZooKeeper and FlatBuffers
Ravi Okade
 
PPTX
Zookeeper
santosh sahoo
 
PDF
Базы данных. ZooKeeper
Vadim Tsesko
 
PPTX
Apache zookeeper 101
Quach Tung
 
PDF
Distributed system coordination by zookeeper and introduction to kazoo python...
Jimmy Lai
 
PDF
A Python Petting Zoo
devondjones
 
PDF
Apache ZooKeeper TechTuesday
Andrei Savu
 
PDF
ZooKeeper Recipes and Solutions
Jeff Smith
 
PDF
ZooKeeper Recipes and Solutions
Jeff Smith
 
PDF
ZooKeeper Recipes and Solutions
Jeff Smith
 
PPTX
Zookeeper
venkata ramireddy
 
PDF
zookeeperProgrammers
Hiroshi Ono
 
PPTX
ZooKeeper (and other things)
Jonathan Halterman
 
Zookeeper Tutorial for beginners
jeetendra mandal
 
Leo's Notes about Apache Kafka
Léopold Gault
 
Meetup on Apache Zookeeper
Anshul Patel
 
Winter is coming? Not if ZooKeeper is there!
Joydeep Banik Roy
 
Apache zookeeper seminar_trinh_viet_dung_03_2016
Viet-Dung TRINH
 
Tech Talks_25.04.15_Session 3_Tibor Sulyan_Distributed coordination with zook...
EPAM_Systems_Bulgaria
 
Zookeeper Architecture
Prasad Wali
 
ZeroMq ZooKeeper and FlatBuffers
Ravi Okade
 
Zookeeper
santosh sahoo
 
Базы данных. ZooKeeper
Vadim Tsesko
 
Apache zookeeper 101
Quach Tung
 
Distributed system coordination by zookeeper and introduction to kazoo python...
Jimmy Lai
 
A Python Petting Zoo
devondjones
 
Apache ZooKeeper TechTuesday
Andrei Savu
 
ZooKeeper Recipes and Solutions
Jeff Smith
 
ZooKeeper Recipes and Solutions
Jeff Smith
 
ZooKeeper Recipes and Solutions
Jeff Smith
 
zookeeperProgrammers
Hiroshi Ono
 
ZooKeeper (and other things)
Jonathan Halterman
 
Ad

Recently uploaded (20)

PDF
Next level data operations using Power Automate magic
Andries den Haan
 
PDF
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 
PDF
Kubernetes - Architecture & Components.pdf
geethak285
 
PDF
Redefining Work in the Age of AI - What to expect? How to prepare? Why it mat...
Malinda Kapuruge
 
PDF
My Journey from CAD to BIM: A True Underdog Story
Safe Software
 
PDF
TrustArc Webinar - Navigating APAC Data Privacy Laws: Compliance & Challenges
TrustArc
 
PDF
LLM Search Readiness Audit - Dentsu x SEO Square - June 2025.pdf
Nick Samuel
 
PDF
Java 25 and Beyond - A Roadmap of Innovations
Ana-Maria Mihalceanu
 
PDF
Unlocking FME Flow’s Potential: Architecture Design for Modern Enterprises
Safe Software
 
PPTX
Enabling the Digital Artisan – keynote at ICOCI 2025
Alan Dix
 
PDF
''Taming Explosive Growth: Building Resilience in a Hyper-Scaled Financial Pl...
Fwdays
 
PPTX
Smart Factory Monitoring IIoT in Machine and Production Operations.pptx
Rejig Digital
 
PDF
DoS Attack vs DDoS Attack_ The Silent Wars of the Internet.pdf
CyberPro Magazine
 
PDF
How to Visualize the ​Spatio-Temporal Data Using CesiumJS​
SANGHEE SHIN
 
PDF
Automating the Geo-Referencing of Historic Aerial Photography in Flanders
Safe Software
 
PDF
Understanding The True Cost of DynamoDB Webinar
ScyllaDB
 
DOCX
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
PPTX
Mastering Authorization: Integrating Authentication and Authorization Data in...
Hitachi, Ltd. OSS Solution Center.
 
PDF
Dev Dives: Accelerating agentic automation with Autopilot for Everyone
UiPathCommunity
 
PDF
GDG Cloud Southlake #44: Eyal Bukchin: Tightening the Kubernetes Feedback Loo...
James Anderson
 
Next level data operations using Power Automate magic
Andries den Haan
 
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 
Kubernetes - Architecture & Components.pdf
geethak285
 
Redefining Work in the Age of AI - What to expect? How to prepare? Why it mat...
Malinda Kapuruge
 
My Journey from CAD to BIM: A True Underdog Story
Safe Software
 
TrustArc Webinar - Navigating APAC Data Privacy Laws: Compliance & Challenges
TrustArc
 
LLM Search Readiness Audit - Dentsu x SEO Square - June 2025.pdf
Nick Samuel
 
Java 25 and Beyond - A Roadmap of Innovations
Ana-Maria Mihalceanu
 
Unlocking FME Flow’s Potential: Architecture Design for Modern Enterprises
Safe Software
 
Enabling the Digital Artisan – keynote at ICOCI 2025
Alan Dix
 
''Taming Explosive Growth: Building Resilience in a Hyper-Scaled Financial Pl...
Fwdays
 
Smart Factory Monitoring IIoT in Machine and Production Operations.pptx
Rejig Digital
 
DoS Attack vs DDoS Attack_ The Silent Wars of the Internet.pdf
CyberPro Magazine
 
How to Visualize the ​Spatio-Temporal Data Using CesiumJS​
SANGHEE SHIN
 
Automating the Geo-Referencing of Historic Aerial Photography in Flanders
Safe Software
 
Understanding The True Cost of DynamoDB Webinar
ScyllaDB
 
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
Mastering Authorization: Integrating Authentication and Authorization Data in...
Hitachi, Ltd. OSS Solution Center.
 
Dev Dives: Accelerating agentic automation with Autopilot for Everyone
UiPathCommunity
 
GDG Cloud Southlake #44: Eyal Bukchin: Tightening the Kubernetes Feedback Loo...
James Anderson
 

Apache Zookeeper Explained: Tutorial, Use Cases and Zookeeper Java API Examples

  • 2. Agenda  Coordination headache in distributed applications  What is zookeeper?  Zookeeper Overview  Zookeeper Service & Data Model  ZAB (Zookeeper Atomic Broadcasting Protocol)  Zookeeper Read, Write and Watch  Zookeeper Use Cases  Zookeeper Client API Example
  • 3. Coordination headache in distributed applications  Problem of Detection  Cluster Size Estimation  Leader Election  Group Membership  Configuration Management  Consensus among multiple parties is difficult in dynamic distributed systems as members may leave/fail/join anytime  Consistency, Availability and Partition tolerance
  • 4. What is Zookeeper?  Apache Zookeeper is a highly consistent, scalable and reliable cluster co-ordination service.  Zookeeper is a CP system where Consistency and Partition tolerance are guaranteed.  Off-the-shelf support for implementing consensus, group management, leader election etc.  Zookeeper cluster is called Ensemble  Ensemble has one leader and remaining followers  Zookeeper is a Distributed Coordination Service for Distributed Applications.  Zookeeper is originally developed by Yahoo research Team and became a top level Apache project. Zookeeper is used by many enterprises including Rackspace, Yahoo! and eBay.
  • 5. Zookeeper Overview  Zookeeper use Zookeeper Broadcasting Protocol (ZAB) for ordering and integrity.  Achieves High availability and performance via replication.  Low latency and high throughput via in memory image of data tree ,transaction logs and snapshots.  Uses “quorum” model and will only be available if a majority of servers are alive (by a strict majority of nodes).  Zookeeper relies on a quorum for durability as well.  Pipelined architecture of Zookeeper enables the execution of operations from a single client in FIFO order.  Ordered updates uses ZAB protocol (a leader-based atomic broadcast protocol) for Ordering, Integrity , exactly once.  Election of a new leader is followed by a synchronization phase before any new changes are accepted.
  • 6. Zookeeper Service & Data Model  At any given time, one Zookeeper client is connected to one Zookeeper server.  If the node (to which client connected) fails, client automatically connect to another server in ensemble with transparent session transfer.  Znode is an in-memory data node in Zookeeper Data organized in a hierarchical namespace (data tree)  The data model of ZooKeeper (znode) is essentially a file system with a simplified API and associated meta data and versions.  Regular, Ephemeral and Sequential Znode are supported.  Each ZNode is using UNIX style notation. For example, /A/B/C to denote the path to znode C, where C has B as its parent and B has A as its parent.  All znodes store data, and all znodes, except for ephemeral znodes, can have children.
  • 7. Zookeeper read/write/watch  Clients make use of Zookeeper API to update/write Zookeeper the data tree.  All Updates are ordered and managed by leader with unique zxid and are considered complete when a quorum confirms the update.  The leader executes update request and broadcasts the change to the ZooKeeper state through Zab.  Zab by default uses a simple majority quorums to decide on a proposal.  Read and Watch requests on the znode sent by a client to a ZooKeeper server are processed locally.  Watch –Allows client to get notification if an already returned information gets updated.
  • 9. Zookeeper read/write/watch  Read and Watch requests on the znode are processed locally but, write requests are propagated to leader server and go through a consensus before a response is generated.  Throughput of read request increases with number of servers and throughput of write requests, decreases with number of servers.
  • 10. Zookeeper use cases  ZooKeeper offers the library to create and manage synchronization primitives.  ZooKeeper avoids the single-point-of-failure. Typical use cases ,  Naming service  Configuration management  Synchronization  Leader election  Message Queue  Notification system
  • 11. Zookeeper Java Client API Examples  A simple example.  To check the complete example see at the below link.  http://java.globinch.com/enterprise- services/zookeeper/apache-zookeeper-explained- tutorial-cases-zookeeper-java-api-examples/

Editor's Notes

  • #4: 1)Number of non-faulty nodes currently in the system (heartbeat.Distributed Hashtables (DHT)) Leader/master detection & availability Membership notifications etc. 2)