

Ask HN: Etcd or ZooKeeper? - jaytaylor

What do you see as the pros and cons of each, and why do you prefer one over the other?
======
Randgalt
I'm the main author of Apache Curator (a ZooKeeper JVM client/lib). My biggest
concern would be availablity of reliable, well tested implementations. For
example, Curator gives you well tested locks, leaders, registries, etc. If you
have to roll your own versions of these things you're bound to mess it up.
I've never used etcd so I don't know if it has that.

Another thing to consider - is something else in your stack using ZK.
ZooKeeper is a component in a lot of existing open source libs: Kafka, Hadoop,
etc. So, if it's already in your cluster you might as well use it for other
things.

------
johnnycarcin
What are you looking to do? Provision these services once and then leave them
or are they something you want to be able to auto-scale?

From my experience zookeeper is rock solid from an operations perspective when
built on top of the right infrastructure (follow their best practices) but if
you want something that you can scale via automation it's kind of a pain. We
were able to hack up some stuff to do it but it wasn't ideal. Additionally I
feel that their documentation and API are a little less friendly compared to
the others. It also feels much "heavier" compared to etcd in my opinion.

I haven't touched etcd in over 6 months and it's my understanding that it has
changed quite a bit so keep that in mind. I felt the provisioning process for
etcd was a bit painful at the start but once you had a cluster up and running
it was easy to add new nodes. The API was really easy to get started with as
well but being such a fast moving project there were a couple of times where
the documentation I had found ended up being out-of-date aka wrong.

Have you looked at consul by chance? We actually ended up using it as it
seemed to be a good fit between stability, ease of use and maintainability.

~~~
jaytaylor
> What are you looking to do? Provision these services once and then leave
> them or are they something you want to be able to auto-scale?

Lately I've been doing Leader Election and Service Discovery with ZooKeeper.
I've really appreciated the excellent documentation and thoroughness of the
best-practices information.

> ...It also feels much "heavier" compared to etcd in my opinion.

Agreed 100% there. ZK also imposes some [rather harsh] limitations - e.g. 1MB
max response packet size. Not sure how this compares to the limits of etcd or
Consul.

> Have you looked at consul by chance? We actually ended up using it as it
> seemed to be a good fit between stability, ease of use and maintainability.

This is not the first time I've seen Consul mentioned. I'll definitely add it
to my list of possible future fits :)

The operability of ZooKeeper seems unparalleled, likely [largely] due to being
the most mature OSS solution in existence for this domain.

