Guarantees Provided by Zookeeper
Let's look into the Zookeeper's consistency model and the guarantees that it provides.
Zookeeper’s consistency model
The formal consistency model by Zookeeper lies between sequential consistency and linearizability, called
Safety Guarantees
Zookeeper provides the following safety guarantee:
Linearizable writes
All requests that update the state of Zookeeper are linearizable and respect precedence. This means that each write operation will take effect atomically at some point between when the client issues the request and receives the corresponding response.
However, merely stating that write operations are linearizable is meaningless since we need to perform read operations to notice their effects.
Sequentially consistent reads
Read operations will take effect in some sequential order that respects the order of each client’s operations. As they are ordered sequentially consistent.
FIFO client order
Zookeeper executes all the clients’ requests in the exact order in which they are sent.
Note: Zookeeper also provides an ordering guarantee. If a client is waiting for a change, the client will see the notification event before it sees the new state of the system. As a result, when a client receives a notification and performs a read, the result will reflect all writes at least up to the one that triggered this notification.
Liveness and durability guarantees
Zookeeper also provides liveness and durability guarantees.
Liveness
If a majority of servers are active and communicating, the service will be available.
Durability
If the service responds successfully to a change request, that change will persist across any number of failures as long as a quorum of servers is eventually able to recover.
Get hands-on with 1400+ tech skills courses.