Skip to main content
InterviewHubPRO
Section Overview
Q14

Question 14 of 50

Part 2: Core Architecture & Implementation (Mid-Level)

28%
Kubernetes (K8s) (50 Qs)•Part 2: Core Architecture & Implementation (Mid-Level)

The etcd Distributed Datastore: Raft Consensus, Quorum, and Latency.

senior LevelSystem Design

In Simple Words: etcd is a strongly consistent (CP), distributed key-value store using the Raft consensus algorithm. Every Kubernetes object is stored in etcd under keys prefixed with /registry/.

Quorum Calculation:

$$\text{Quorum} = \left\lfloor \frac{N}{2} \right\rfloor + 1$$

  • A 3-node etcd cluster tolerates 1 failure ($2$ required for quorum).
  • A 5-node etcd cluster tolerates 2 failures ($3$ required for quorum).
  • Clusters must always have an odd number of nodes (3 or 5). Adding a 4th node does not increase fault tolerance; it only increases network consensus overhead!
  • etcd requires sub-10ms disk write latency (fsync). Placing etcd on slow HDDs or shared spinning disks causes heartbeat timeouts, triggering leader election storms that freeze the entire Kubernetes cluster.