Inferensys

Glossary

etcd

etcd is a strongly consistent, distributed key-value store that provides a reliable way to store data that needs to be accessed by a distributed system or cluster, and serves as the primary datastore for Kubernetes, holding all cluster state.
Data engineer managing feature store on laptop, feature definitions visible, casual data engineering session.
DISTRIBUTED SYSTEMS

What is etcd?

A technical definition of etcd, the distributed key-value store that serves as the primary datastore for Kubernetes.

etcd is a strongly consistent, distributed key-value store that provides a reliable way to store data that needs to be accessed by a distributed system or cluster. It serves as the primary datastore for Kubernetes, holding all cluster state, including node information, Pod scheduling, and Service definitions. Its core function is to maintain a replicated, fault-tolerant log of configuration data using the Raft consensus algorithm to ensure all nodes agree on the system's state.

In Edge AI Orchestration, etcd is critical for the control plane of systems like Kubernetes, enabling leader election, state reconciliation, and coordination across a fleet of devices. It provides the foundational declarative configuration backend, allowing the orchestration layer to manage the desired state of distributed AI workloads and hardware resources. Its strong consistency guarantees are essential for maintaining a single source of truth in dynamic, resilient edge environments.

DISTRIBUTED SYSTEMS

Key Features of etcd

etcd is a strongly consistent, distributed key-value store that provides a reliable way to store data that needs to be accessed by a distributed system or cluster. It serves as the primary datastore for Kubernetes, holding all cluster state. Its design prioritizes consistency, reliability, and simplicity for critical coordination tasks.

01

Strong Consistency via Raft

etcd uses the Raft consensus algorithm to guarantee strong consistency across all nodes in the cluster. All write operations must be committed by a quorum (majority) of nodes before being acknowledged to the client, ensuring linearizable reads. This prevents split-brain scenarios and guarantees that a client reading from any node sees the most recent write.

  • Leader Election: A single leader handles all client requests, simplifying the replication log.
  • Log Replication: The leader replicates each state change to follower nodes.
  • Fault Tolerance: The cluster can tolerate the failure of (N-1)/2 nodes, where N is the cluster size.
02

Distributed Key-Value Store

At its core, etcd is a key-value store where keys are hierarchically organized, similar to a filesystem. This simple data model is exposed via a gRPC API and a JSON-over-HTTP API. It supports standard operations like PUT, GET, DELETE, and WATCH.

  • Hierarchical Keys: Keys are organized in a directory-like structure (e.g., /registry/pods/default/my-pod).
  • Range Queries: Efficiently retrieve all keys under a prefix.
  • Leases & TTLs: Keys can be associated with time-bound leases, automatically expiring for service discovery and leader liveness.
03

Watch for State Changes

The watch API allows clients to subscribe to changes on specific keys or key prefixes. This is the foundation for the control loops in systems like Kubernetes. When a key's value is updated, all watching clients are notified with the new data, enabling reactive systems without inefficient polling.

  • Event Streams: Clients receive a continuous stream of create, update, and delete events.
  • Historical Events: Watches can be started from a specific revision in the past.
  • Compact Notification: Efficiently handles scenarios where the event history is compacted.
04

Multi-Version Concurrency Control (MVCC)

etcd implements MVCC, storing every change to a key as a new revision. This creates a complete, immutable history of the datastore. Reads are performed at a specific revision, providing consistent snapshots and enabling features like watch from a past revision.

  • Revision Numbers: Each transaction increments a global, monotonically increasing revision counter.
  • Snapshot Isolation: Reads are never blocked by writes.
  • History Compaction: Old revisions can be periodically compacted to reclaim disk space, while preserving a configurable window of history.
05

Secure by Default

etcd provides robust security features for production clusters. Communication can be encrypted with Transport Layer Security (TLS), and access to keys is controlled via role-based access control (RBAC).

  • Peer & Client TLS: Encrypts traffic between etcd members and between clients and the cluster.
  • Client Certificate Authentication: Clients authenticate using X.509 certificates.
  • Fine-Grained RBAC: Permissions (read, write, readwrite) can be assigned to users and roles for specific key ranges.
06

High Availability & Durability

Designed for high availability, etcd clusters typically run with an odd number of nodes (3, 5, 7) to maintain a quorum during failures. Data durability is ensured by writing all committed entries to a persistent write-ahead log (WAL) on disk before applying them to the in-memory state machine. Snapshots of the state are also periodically written to disk.

  • Quorum-Based Operations: Requires a majority of nodes to be healthy for writes.
  • Persistent Storage: The WAL and snapshots ensure data survives process restarts.
  • Member Management: Nodes can be added, removed, or replaced dynamically with minimal downtime.
DISTRIBUTED KEY-VALUE STORE

How etcd Works

etcd is the foundational distributed key-value store for Kubernetes, providing a reliable, strongly consistent data layer for cluster state.

etcd is a strongly consistent, distributed key-value store that provides a reliable way to store data that needs to be accessed by a distributed system or cluster. It serves as the primary datastore for Kubernetes, holding all critical cluster state, including node information, Pod schedules, and Service endpoints. Its primary role is to act as the single source of truth for the entire orchestration system's configuration and status.

Internally, etcd uses the Raft consensus algorithm to ensure all data changes are consistently replicated across a cluster of nodes, providing fault tolerance and high availability. For Edge AI Orchestration, this strong consistency is crucial for coordinating distributed inference workloads and managing device fleets. The system exposes a simple gRPC API for reading, writing, and watching keys, enabling components like the Kubernetes control plane to react instantly to state changes and perform continuous state reconciliation.

FEATURE COMPARISON

etcd vs. Alternative Distributed Stores

A technical comparison of distributed key-value stores used for cluster coordination and state management in edge AI orchestration and other distributed systems.

Feature / MetricetcdApache ZooKeeperConsul

Primary Use Case

Strongly consistent key-value store for cluster coordination

Centralized service for configuration, synchronization, and naming

Service discovery and configuration with multi-datacenter support

Consensus Algorithm

Raft

Zab (ZooKeeper Atomic Broadcast)

Raft

Data Model

Key-value with versioning and leases

Hierarchical key-value (znodes) with watches

Key-value with ACLs and service catalog

Primary Interface

gRPC/HTTP JSON API

Custom TCP binary protocol

HTTP/HTTPS and DNS interfaces

Watch/Notify Mechanism

Efficient range watches via gRPC streams

One-time triggers on znode changes

Blocking queries and event streams

Built-in Service Discovery

No (requires external layer)

Yes (via ephemeral znodes)

Yes (first-class feature with health checks)

Multi-Datacenter Replication

Limited (manual configuration)

No (single ensemble per DC)

Yes (first-class WAN gossip)

Kubernetes Integration

Primary datastore (control plane)

Used by some systems (e.g., Kafka, HDFS)

Optional service mesh (Consul Connect)

Default Consistency Guarantee

Linearizable (strong) reads and writes

Linearizable writes, sequential consistency for reads

Default strong consistency, tunable to eventual

Performance (Latency for writes)

< 10 ms (typical, within a DC)

< 20 ms (typical, within an ensemble)

< 15 ms (typical, within a DC)

Memory Footprint (Minimum)

~512 MB (recommended for production)

~1 GB (heap, varies with znodes)

~256 MB (core server)

Authentication & Authorization

Role-Based Access Control (RBAC)

Access Control Lists (ACLs) on znodes

ACLs with policies and tokens

DISTRIBUTED SYSTEMS FOUNDATION

Where etcd is Used

etcd's strong consistency and reliability make it the foundational data store for critical coordination and configuration management in modern distributed systems.

04

Edge AI & IoT Orchestration

In Edge AI Orchestration, etcd is used as the source of truth for the desired state of a distributed fleet of edge devices. An orchestration plane (like a lightweight Kubernetes distribution, e.g., K3s) uses etcd to store:

  • Device inventory and status (online/offline, resource utilization).
  • Model deployment manifests specifying which AI models should run on which edge nodes.
  • Configuration profiles for sensors and local inference pipelines.
  • Rollout policies for staged model updates across thousands of geographically dispersed devices. Its ability to operate in high-latency, occasionally connected environments (with proper tuning) makes it suitable for edge deployments.
< 1 sec
Typical Leader Election
99.9%
Typical Availability SLA
ETCD

Frequently Asked Questions

etcd is the foundational distributed key-value store for Kubernetes and modern cloud-native infrastructure. These FAQs address its core functions, architecture, and role in edge AI orchestration.

etcd is a strongly consistent, distributed key-value store that provides a reliable way to store data that needs to be accessed by a distributed system or cluster. It works by maintaining a replicated log of state changes across a cluster of nodes using the Raft consensus algorithm. All write requests are proposed to a single elected leader node, which replicates them to follower nodes. A write is only committed and applied to the key-value store once a majority of nodes in the cluster have durably persisted the log entry, guaranteeing linearizable consistency. This makes etcd the definitive source of truth for a system's configuration data, service discovery information, and scheduler state.

In Kubernetes, etcd holds the entire cluster state, including all Pod, Deployment, Service, and Node objects. The Kubernetes API server is the only component that communicates directly with etcd, acting as a gateway. All other controllers, like the kube-scheduler and kube-controller-manager, watch for changes in this state via the API server to perform state reconciliation.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.