Book Image

Apache ZooKeeper Essentials

By : Haloi
Book Image

Apache ZooKeeper Essentials

By: Haloi

Overview of this book

Whether you are a novice to ZooKeeper or already have some experience, you will be able to master the concepts of ZooKeeper and its usage with ease. This book assumes you to have some prior knowledge of distributed systems and high-level programming knowledge of C, Java, or Python, but no experience with Apache ZooKeeper is required.
Table of Contents (9 chapters)
4
4. Performing Common Distributed System Tasks
8
Index

Chapter 4. Performing Common Distributed System Tasks

In the previous chapter, you learned about the ZooKeeper client API and programming using the APIs. You saw how to write a client to connect to the ZooKeeper server instance and execute methods to carry out operations in the ZooKeeper namespace. You also learned how to implement watchers in a client so as to register for specific events and get notifications when such events occur, all in real time.

The simple yet powerful and elegant programming model of ZooKeeper enables us to implement high-level primitives for distributed systems. For example, we used the concept of ephemeral znodes to build an emulation of a cluster monitor in the previous chapter.

In this chapter, you will learn:

  • How to carry out common distributed system tasks such as leader election, group memberships, and two-phase commit protocol
  • How to implement a few distributed data structures such as barriers, locks, and queues

The high-level constructs outlined in...