
Etcd
Distributed key-value store with Raft-backed consistency
Replaces Hashicorp Consul

Who it's for
If you are deploying or operating a Kubernetes cluster, Etcd is not optional: it is the control plane's data store. Knowing how to back it up, restore it, and monitor quorum health is a core operational skill for any team managing Kubernetes in production.
You are using a managed Kubernetes service where the control plane, including Etcd, is managed by the cloud provider.
If your application needs distributed locks, leader election, or a consistent configuration store shared across a fleet of nodes, Etcd provides the building blocks. The lease and watch primitives give you the foundation for these patterns without writing your own consensus logic.
Your application is a single-node service with no distributed coordination requirements.
Teams building a lightweight service registry can use Etcd's watch mechanism to propagate service registration and deregistration events in real time. Each service writes its address to a leased key; when the service stops refreshing the lease, the key expires and downstream watchers see the removal automatically.
You need DNS-based service discovery or health checks out of the box; consider a tool that includes those natively.
The problem
Distributed systems need a small, authoritative store for coordination data: which node is the current leader, what the cluster membership looks like, and what state each component has committed. Solving this with a general-purpose database or a shared file system means accepting inconsistency during network splits or node failures, which produces split-brain scenarios where separate parts of a cluster make conflicting decisions and corrupt shared state. The hardest part is not the steady state; it is making the right decision when a network partition separates some nodes from the leader. Without a consensus-based store, teams either accept eventual consistency and risk conflicting writes, or add custom quorum logic on top of a datastore that was not designed for it. Neither path gives the guarantees needed to run critical infrastructure at scale, which is why Kubernetes, locksmith, Doorman, and similar systems are built on top of a dedicated coordination store.
How it works
Every write is replicated to a majority of cluster nodes before being acknowledged. If a network partition or node failure occurs, Etcd holds an election and elects a new leader from the surviving quorum without data loss. The Raft algorithm ensures that only one leader can commit writes at any time, preventing split-brain state corruption.
The primary API is gRPC, with HTTP/JSON proxied through a gateway for tools that prefer curl or standard HTTP clients. This means you can read and write keys from any language with a gRPC client and also interact with the cluster directly from the command line using etcdctl, the bundled CLI tool.
Clients can watch individual keys or key prefixes and receive a notification the moment a value changes. Kubernetes uses this mechanism to distribute state updates across controllers: when a pod is scheduled, the watch fires and the relevant nodes react. The watch stream remains open across leader elections.
Etcd supports full TLS encryption for both client-to-server and server-to-server traffic, with optional client certificate authentication. This means you can require every client to present a trusted certificate before reading or writing keys, which is the production security baseline for clusters handling secrets.
Keys can be attached to a lease with a time-to-live. When the lease expires, all keys attached to it are automatically deleted. This is the primitive that enables distributed locks and leader election: a node holds a lease and refreshes it; if the node fails, the lease expires and another node can claim the key.
Features
- Raft Consensus Replication
- gRPC API with HTTP/JSON Proxy
- Real-Time Key-Change Watching
- TLS and Client Certificate Authentication
- Key TTL and Lease-Based Expiration
How to install
Download pre-built binaries for Linux, macOS, and Windows from GitHub Releases: https://github.com/etcd-io/etcd/releases/latest
Recommended for this setup
Strengths
- Apache 2.0 License: Etcd is licensed under Apache 2.0, an OSI-approved license with no restrictions on commercial use or distribution. You can run it internally, modify it, include it in a product, or build a business on top of it without any licensing fees or required disclosures beyond attribution.
- CNCF Graduated Project: Etcd is a graduated Cloud Native Computing Foundation project, meeting the CNCF's production-readiness standards: active maintenance, a defined governance model, and security review processes. The maintainer team holds weekly community and triage meetings and publishes meeting recordings to the official YouTube channel.
- Proven at Kubernetes Scale: Kubernetes uses Etcd as the sole storage backend for all cluster state: nodes, pods, services, secrets, and config maps. With 52,617 GitHub stars and in-production use at thousands of organizations, the operational edge cases are well-documented and community-tested.
Trade-offs
- Narrow Use Case by Design: Etcd is not a general-purpose database and is not designed for large values, high-cardinality analytics, or write-heavy workloads beyond its benchmarked limits. The recommended use is small configuration and coordination data; storing application content, user data, or large blobs in Etcd degrades cluster performance and is explicitly discouraged in the documentation.
- Production Requires a Multi-Node Cluster: A single-node Etcd instance has no fault tolerance: any failure takes down the store. Production use requires at least three nodes to maintain a quorum. Managing a three-node cluster, handling upgrades, and monitoring quorum health adds operational work that teams often underestimate when first deploying it.
- Main Branch is Unstable: The README explicitly states the main branch may be in an unstable or even broken state during development. For production, you must use a tagged release from the releases page, not the tip of main. Teams that pin dependencies to main branches will encounter build failures.
Tech stack
FAQ
Etcd predates Kubernetes and is used independently by distributed systems like Doorman, locksmith, and vulcand, as listed in the README. Kubernetes is by far the largest consumer, but any application that needs a strongly consistent, distributed configuration or coordination store can use Etcd directly through its gRPC API or one of the language client libraries documented at etcd.io/docs/latest/integrations.
Three nodes is the minimum for a fault-tolerant production cluster. Raft requires a quorum, so a three-node cluster can survive one node failure. A five-node cluster can survive two. A single-node cluster has no fault tolerance: any failure makes Etcd unavailable and your Kubernetes cluster or dependent services will halt. The etcd documentation covers multi-node clustering setup in detail.
The README and product website both document a benchmark of 10,000 writes per second. The website also notes thousands of writes per second as typical. Actual throughput depends on hardware, network latency, and value size; small coordination keys on modern hardware will often exceed these benchmarks, while large values or high-latency networks will fall below them.
Etcd encrypts traffic in transit using TLS, with optional client certificate authentication. Encryption at rest is not built into Etcd itself; it relies on disk-level or filesystem-level encryption provided by the host operating system or storage layer. Teams running Kubernetes can configure Kubernetes-level secret encryption, which encrypts the data before it reaches Etcd.
The etcdctl CLI tool, which ships with Etcd, includes a snapshot command that creates a consistent backup of the whole keyspace. For Kubernetes deployments, backing up Etcd is part of the standard cluster backup procedure. The etcd documentation at etcd.io/docs covers snapshot and restore procedures. Because Etcd holds the authoritative state of a Kubernetes cluster, regular snapshots are a production requirement.