Etcd v3: increased scale and new APIs
coreos.com
coreos.com
Consul provides features like health checking, failure detection besides its consistent key-value store. It aims to provide an all-in-one solution[0].
etcd focuses on the consistent key-value store. The key-value store has more advanced features like multi-version keys, reliable watches, and provides better performance. People build additional features on top of etcd's key-value store/raft.
(I work on etcd)
etcd: https://github.com/coreos/etcd/blob/master/Documentation/op-...
Note that the testing environments are not exact the same in the doc I listed, but comparable. Also Consul performance is improved after a few releases.
So we did the benchmark internally on the same environment. The result is still comparable to what I listed in the two official docs.
The best way to compare performance is still probably to run the benchmark on your own environment.
Etcd can provide faster election notifications but it comes at the cost of etcd still being pretty new, so be prepared to get cut by the bleeding edge :)
Etcd uses Raft and ZooKeeper uses it's own protocol called Zab [0]. Zab shares some characteristics with Paxos but certainly IS NOT Paxos.
[0] https://cwiki.apache.org/confluence/display/ZOOKEEPER/Zab+vs...
The following two paragraphs from the etcd project site seem to hint that they're trying to target overlapping use cases: "Your applications can read and write data into etcd. A simple use-case is to store database connection details or feature flags in etcd as key value pairs. These values can be watched, allowing your app to reconfigure itself when they change.
Advanced uses take advantage of the consistency guarantees to implement database leader elections or do distributed locking across a cluster of workers."
Edit: They haven't been published to the docs on the CoreOS website yet, but there are two documents listed under "upgrading and compatibility" at the bottom of https://github.com/coreos/etcd/blob/v3.0.0/Documentation/doc...
Doc is here: https://github.com/coreos/etcd/blob/master/Documentation/upg...
Using e.g. gRPC shows great promise, but systems like ZooKeeper still play nicer in more traditional Java shops, or do they? How hard is it to use etcd from the JVM?
For the gRPC API, it is easy to generate a Java gRPC client based on the defined service. We have plans to make that experience better.
Zookeeper has been around now for over 5 years with an extremely large install base.
Kafka, Hadoop, Solr, Mesos and Hbase projects that leverage Zookeeper distributed coordination.
Zookeeper has already delivered.
It feels like etcd is 'still discovering itself' for lack of better words.
Btw: https://issues.apache.org/jira/browse/ZOOKEEPER-2169 (this is the equivalent of TTLs for zookeeper).
It would be great if you can provide opinions, comments or help on these high level APIs. We also might move these to an internal proxy layer, so that other clients in other language can use it more easily.
(some more here: https://github.com/coreos/etcd/tree/master/contrib/recipes)
Has anyone verified the implementation?
Zookeeper is at least based on Paxos which has a TLA+ model one can check.
For etcd, we try to keep the core algorithm as self-contained and deterministic (no I/O, no timer) as possible. So it can be very close to the pure algorithm. We are very confident about it since we throughly tested it, and the implementation is shared with other consistent large scale database systems too (cockroachdb, tikv).
ZooKeeper uses ZAB [1] under the hood. I do not think there is a TLA+ for ZAB.
[0] https://www.cs.utexas.edu/users/lorenzo/corsi/cs380d/papers/...
[1] http://www-users.cselabs.umn.edu/classes/Spring-2016/csci821...
I'm aware that implementations diverge or do not directly synthesize from their specifications. At least not yet.
I'll be poking around more to see if the etcd team has published their own specs for the novel parts of the system. I'm particularly interested in seeing if/how OSS projects are adopting more rigorous "engineering" practices.
(though i'm pretty excited about the raft impl my summer intern and I are hacking on currently :) )
But yes that's the plan.
I tried using both the Consul and etcd Raft implementations as libraries. I found the Consul library much easier to interface with. But it was my impression that the etcd library was much more tested in the real-world, with big projects like Kubernetes and with the library being embedded into projects like CockroachDB. I also wasn't sure if the details that the Consul implementation was hiding were actually important.
None of these are afaik things built in to raft but are add-ons that etcd has created (that may or may not even use raft).
It'd be great to instill confidence in these add-on features by having them peer-reviewed in a similar manner as raft is/was/has been.
https://cwiki.apache.org/confluence/display/ZOOKEEPER/Zab+vs...