Module 10b - Apache ZooKeeper Flashcards
What is ZooKeeper?
ZooKeeper is a centralized service for maintaining configuration information, naming, providing distributed synchronization, and providing group services.
ZK is a high performance coordination service for distributed applications
What does CAP stand for?
Consistency, Availability, Partition tolerance
In a distributed system following a hierarchical structure, the master is prone to ______, and so we may want to spin up a ______ master. This is facilitated by a _______ service
failures
backup
coordination
ZooKeeper’s architecture supports high ________ through ________ services. The clients can thus ask another ZooKeeper leader if the first fails to answer.
availability
redundant/replicated
What protocols can you implement with ZooKeeper in a distributed system?
- Consensus
- Group Management
- Leader election
- Presence Protocols
ZooKeeper exposes a simple set of ______ that ______ applications can build upon to implement ______ level services.
primitives
distributed
higher
What high level services can the ZooKeeper primitives be used to implement?
- Synchronization
- Configuration Maintenance
- Groups
- Naming
What are ZNodes?
Data registers. They are similar to files and directories.
Filesystem files are designed for storage, whereas ZooKeeper data is kept _______, allowing Zookeeper to achieve high _______ and low _______.
in-memory
throughput
latency
Like the distributed processes it coordinates, ZooKeeper itself is intended to be _______ over a set of hosts called an ensemble.
replicated
The servers that make up the ZooKeeper service must all know about each other. As long as a ______ of the servers are available, the ZooKeeper service will be available
majority
Clients connect to a single ZooKeeper server. The client maintains a ___ connection. If the TCP connection to the server breaks, the client will connect to a _____ server.
TCP
different
ZooKeeper is fast in ______ dominant workloads
read
The data stored at each ZNode is _____ in size
small
ZNodes have a _______ number associated with them which is maintained with a stat structure. Each time a ZNode’s ______ is changed, this number is number increases
version
data
The data stored at each ZNode in a namespace is read and written _____. A write to a ZNode _____ all the data
atomically
replaces
Each ZNode has an ACL. What is an ACL?
Access Control List. Restricts who can do what
ZooKeper has the concept of ephemeral nodes. What are ephemeral nodes?
They are Znodes that exists as long as the session that created that znode is active. When the session expires, the znode is deleted.
Describe the concept of “watches” in ZooKeeper
Clients can set a “watch” on a znode. A watch will be triggered and removed when a znode changes. When a watch is triggered, the client receives a packet saying that the znode has changed.
A guarantee that ZooKeeper provides is Sequential Consistency. Describe the term “sequential consistency” with respect to ZooKeeper
Updates from a client will be applied in the order that they were sent
In ZooKeeper, what does atomicity mean with regards to updating data
Multiple clients updating a single resource will not encounter a race condition. An update will either succeed or fail. No partial Results
What is it mean in ZooKeeper when we say it is a “Single System Image”?
A client will see the same view of the service regardless of the server that it connects to.
A client will never see an older view of the system even if the client fails over a different server with the same session.
In ZooKeeper, once an ______ has been applied, it will ______ from that time forward until a client ______ the update
update
persist
overwrites
We say that ZooKeeper is guaranteed to be “timeless” what does this mean?
The client’s view of the system is guaranteed to be up-to-date within a certain time bound
Why is ZooKeeper very highly performant when reads outnumber writes?
Writes involve synchronizing the state of all servers - which has significant overhead
In ZooKeeper, all write requests from clients are forwarded to a single server called the _____. The rest of the ZooKeeper servers are called ______
leader
followers
What is the Curator API for ZooKeeper?
The Curator is a high-level API built on top of ZooKeeper’s official API. It handles the complexity of managing connections and provides a cleaner interface to the programmer
What is the consistency model used by ZooKeeper?
Sequential consistency and linearizability (for writes)