Ex: Zookeeper
Architecture
Zookeeper is represented like hierarchical namespace.
Zookeeper has master-slave architecture.
Followers must send any write request to leader and wait until it successfully broadcasted.
All nodes have copy of the data in its local cache. So reads are fast.
But followers might be lagging behind. So in this case Zookeeper provides sync operation. In this case all read operations after read would see all writes that happened before sync.
Clients can register watches and get notification if value is updated.
Safety guarantees
- Linearizable writes, all requests that update state are serializable and in order. But writes might be not linear to reads if sync is not used
- FIFO client order, all requests from a given client are executed in order
- If majority of servers are active and communicating - the service will be available
- if the service responds successfully to a change request, that change persists across any number of failures as long as a quorum of servers is eventually able to recover.
ZAB protocol
... TODO
Use cases
- Configuration management.
Config service might create a znode and clients would register watchers and as soon as they are notified they could read new configuration.
- Group management
Create ephemeral child of znode that represents a group etc.