Skip to main content

πŸ—“οΈ 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:
    1. Goes to the leader.
    2. Leader replicates the write to followers via Raft.
    3. Waits for majority acknowledgment.
    4. 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 Caseetcd’s RoleRaft’s Role
KubernetesStores cluster stateEnsures cluster-wide state consistency
Service DiscoveryStores endpointsGuarantees updates are atomic
Feature Flags / ConfigStores dynamic configsKeeps all replicas in sync
Leader ElectionStores leader infoEnsures only one true leader

References