What's the difference between ZooKeeper and any distributed Key-Value stores?

前端 未结 2 1644
离开以前
离开以前 2021-02-07 12:49

I am new to zookeeper and distributed systems, and am learning it myself.

From what I understand for now, it seems that ZooKeeper is simply a key-value store whose keys

2条回答
  •  醉话见心
    2021-02-07 13:42

    You're comparing the high level data model of ZooKeeper to other key value stores, but that's not what makes it unique. From a distributed systems standpoint, ZooKeeper is different than many other key value stores (especially Redis) because it is strongly consistent and can tolerate failures while a majority of the cluster is connected. Additionally, while data is held in memory, it's synchroniusly replicated to a majority of the cluster and backed by disk, so once a write succeeds it guarantees that write will not be lost (barring a missile strike). This makes ZooKeeper very useful for storing small amounts of mission critical state like configurations.

    Conversely, Redis is not a distributed system and does not provide the same sorts of guarantees that ZooKeeper does, and many other key value stores that are distributed are eventually consistent. In other words, there's no guarantee that once a value is written all other processes in a distributed system can see that value.

    Finally, in addition to the file system like interface for storing state, ZooKeeper provides fairly low level features on which more complex problems can be solved. For examples of this look at Apache Curator. Curator uses ZooKeeper's ephemeral nodes (nodes that disappear when the client that created them disconnects) to build things like locks and leader elections which are extremely useful for coordinating distributed systems. So, from that perspective ZooKeeper's data model and associated features serve as primitives on which higher level tools for distributed coordination can be built.

提交回复
热议问题