Benjamin Elder

Digging Into etcd


December 1st, 2019

NOTE: You've discovered a draft post! This entry is still under construction 🚧 and shouldn't be listed anywhere ... 🤔

What Is etcd?

etcd per the official site is:

A distributed, reliable key-value store for the most critical data of a distributed system

I presume etcd is a play on /etc and the long history of nameing daemons with a d suffix, a daemon for your /etc config, though I’ve not yet found proof of this.

Kubernetes uses etcd as the backing store for cluster data, which drove my own interest in collecting the information in this post.

Clearly a lot of clusters out there are using etcd for critical data storage, but how does it work?


For a history of etcd see:

For bonus points:

Roughly etcd was created out of a desire for a distributed data store addressing the following issues:

Initially etcd was used by coreOS' fleet container orchestration system, but it was quickly adopted for other uses and later donated to the CNCF.



Data Model

etcd’s upstream documentation is instructive here:


Leader election is used to maintain a single leader replica, all requests are routed to the leader internally and comitted only after acheiving consensus on the request.

Raft is the consensus algorithm used both requests and for leader elections. The official raft site is a a good reference for understanding how this works. Another great resource linked from the official site is

etcd’s raft implementation is widely used and contains some useful documentation.


Data is stored with a memory-mapped B+ tree using bbolt, a fork of bolt, inspired by LMDB.


Additional Resources

The Carnegie Mellon Database Group “Database of Databases” site has a great page on etcd at