ποΈ 27082025 2343
π
etcd
ABSTRACT
a distributed, consistent, and highly available key-value store
- Commonly used in distributed systems to store configuration, metadata, and state
- kubernetes uses etcd to store:
- Cluster state
- Node information
- Secrets, ConfigMaps
- Role bindings, CRDs, etc.
Key Features:β
- Strong consistency β (linearizable reads/writes)
- High availability β (replicated across nodes)
- Watch support β (clients can subscribe to updates)
- Based on raft consensus algorithm β (ensures cluster-wide agreement)
etcd + Raft in Actionβ
When you use etcd:
- Every write request:
- Goes to the leader.
- Leader replicates the write to followers via Raft.
- Waits for majority acknowledgment.
- Commits the change > responds to client.
- Every read can be:
- Linearizable > from the leader for strong consistency
- Stale > from a follower for better performance
Why This Mattersβ
Use Case | etcdβs Role | Raftβs Role |
---|---|---|
Kubernetes | Stores cluster state | Ensures cluster-wide state consistency |
Service Discovery | Stores endpoints | Guarantees updates are atomic |
Feature Flags / Config | Stores dynamic configs | Keeps all replicas in sync |
Leader Election | Stores leader info | Ensures only one true leader |