admin Posted on 10:00 pm

9 Zookeeper Terminologies: Zookeeper Basics

1. Objective

Before delving further into how ZooKeeper works, we need to know some terminology in ZooKeeper. Today, in this ZooKeeper article, we will learn the fundamental concepts or terminologies of ZooKeeper, in short, to better understand how it works.

So, let’s start with the Apache ZooKeeper terminologies. Zookeeper Terminologies 9 Zookeeper Terminologies: Zookeeper Basics Do you know the reasons why ZooKeeper is so popular?

2. Zookeeper Terminologies

Next, we discuss various terminologies in Apache ZooKeeper:

A. Sessions In ZOOKEEPER operations, sessions are very important. Basically, in a session, the requests are executed in FIFO order. However, the session will be established and a session ID assigned to the client, as soon as the client connects to a server.

Also, to keep the session valid, the client sends heartbeats at a given time interval. There is a case where the ZooKeeper array decides that the client died when it does not receive heartbeats from a client for more than the period, the session timeout that is specified at service start.

Although, session timeouts are typically represented in milliseconds. Additionally, ephemeral znodes created during that session are also deleted when a session ends for any reason.

b. watches

Clocks are a simple mechanism for the client to be notified about changes in ZooKeeper together. While reading a particular znode, clients can set clocks.

Also, for any of the changes in the znode (in which the client is registered), watches send a notification to the registered client. With the znode or changes to the children of the Znode, the changes to the Znode are a modification of the associated data. However, only once, the clocks are activated. It must be done via another read operation if a client wants a notification again.

The client will be disconnected from the server and the associated clocks will also be removed when a connection session expires. Explore ZooKeeper Apps

against Z Nodes

In a ZooKeeper tree, each node is a znode. Basically, it maintains a statistical structure. Stat Structure is a structure that contains version numbers for data changes, ACL changes, and many more. So, Znodes keeps these changes. The stats structure also has timestamps.

The version number, together with the timestamp, allows ZooKeeper to validate the cache and coordinate updates. The version number increments each time the data in a znode changes.

As an example, the client receives the version of the data, each time a client retrieves data. However, you must provide the version of the Znode data that is changing, when a client performs an update or delete. Therefore, the update will fail if the version you provide does not match the actual version of the data.

d. name service

A service that assigns a name to some information associated with that name is what we call a naming service. In addition, we can also extend a name service to a group membership service. Because in this way it is possible to obtain information belonging to the group where the entity whose name we are looking for is located.

my. Closing

We may need to implement distributed mutexes to allow serialized access to a shared resource in our distributed system. Therefore, with ZooKeeper, we can easily implement them.

F. Synchronization

Basically, to synchronize access to shared resources we need Hand in hand with distributed mutexes. However, ZooKeeper provides a simple interface to implement, either by implementing a producer-consumer queue or a barrier.

gram. Configuration management

To centrally store and manage the configuration of our distributed system we can use ZooKeeper. Learn ZooKeeper by ZooKeeper Books

H. electoral leader

The distributed system may have to deal with the issue of node crashes. Also, we may want to implement an automatic failover strategy. For these types of issues, ZooKeeper offers out-of-the-box support through leader choice.

I. ZooKeeper Access Control Using ACLs

To control access to its Znodes (the data nodes in a ZooKeeper data tree), ZooKeeper uses ACLs. So this was all in ZooKeeper Terminologies.

I hope you like our explanation.

Leave a Reply

Your email address will not be published. Required fields are marked *