system-design

Glossary

Every term used in this repo, defined in one or two sentences, in plain English. Bookmark this page. You will come back to it constantly.

Terms are alphabetical. Each links to the chapter where it’s explained properly.

Jump to: A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · Z


A

ACID — The four guarantees a traditional database transaction gives you: Atomicity (all or nothing), Consistency (constraints hold), Isolation (concurrent transactions don’t corrupt each other), Durability (committed data survives a crash). → Transactions

Anti-entropy — Background process where replicas compare data and repair differences, so divergence doesn’t accumulate forever. Merkle trees make the comparison cheap. → Gossip Protocols

API Gateway — A single entry point in front of many backend services that handles auth, rate limiting, routing, and request aggregation, so each service doesn’t have to. → API Gateway

Availability — The fraction of time a system is able to serve requests. “Four nines” = 99.99% = about 52 minutes of downtime per year. → Availability & Reliability

Availability Zone (AZ) — An isolated datacenter within a cloud region, with independent power and networking. Deploying across AZs protects you from one datacenter failing. → Multi-Region & DR

B

Back-of-the-envelope estimation — Quick arithmetic to size a system: users → QPS → storage → bandwidth → machines. The most useful single skill in a design interview. → Back-of-the-Envelope

Backpressure — Signalling upstream to slow down when you can’t keep up, instead of silently queueing forever and collapsing. → Resilience Patterns

Bloom filter — A tiny probabilistic structure that answers “have I seen this?” with “definitely no” or “probably yes.” Uses a fraction of the memory of a real set, at the cost of false positives. → Probabilistic Data Structures

Blue-green deployment — Run two identical production environments; switch all traffic from the old (blue) to the new (green) at once. Instant rollback, double the infrastructure cost. → Deployment Strategies

Bulkhead — Isolating resources (thread pools, connection pools) per dependency, so one slow downstream service can’t consume everything and take down unrelated endpoints. Named after ship compartments. → Resilience Patterns

B-Tree — The balanced-tree structure most relational databases use for indexes and storage. Optimized for reads and in-place updates. Contrast with LSM-tree. → Storage Engines

C

Cache — A fast, small store of data you’d otherwise have to recompute or refetch. Trades freshness for speed. → Caching

Cache-aside (lazy loading) — The app checks the cache; on a miss it reads the database and populates the cache. The most common caching pattern. → Caching

Cache stampede / thundering herd — A popular cache key expires, and thousands of simultaneous requests all miss and hit the database at once, taking it down. → Thundering Herd

CAP theorem — During a network Partition you must choose between Consistency and Availability. Frequently misquoted as “pick 2 of 3.” → CAP & PACELC

CDN (Content Delivery Network) — A global network of edge servers that cache your static content physically near users, cutting latency and origin load. → CDN

CDC (Change Data Capture) — Streaming a database’s row-level changes (usually by reading its replication log) so other systems can react. → Change Data Capture

Circuit breaker — After N consecutive failures calling a dependency, stop calling it for a while and fail fast. Prevents cascading failure and gives the dependency room to recover. → Resilience Patterns

Consensus — Getting a group of machines to agree on a single value despite failures. Raft and Paxos are the algorithms. → Consensus

Consistent hashing — A hashing scheme where adding or removing a node only remaps ~K/N keys instead of nearly all of them. The basis of distributed caches and many NoSQL stores. → Consistent Hashing

CQRS (Command Query Responsibility Segregation) — Separate the write model from the read model, so each can be optimized and scaled independently. → CQRS

CRDT (Conflict-free Replicated Data Type) — A data structure designed so concurrent updates from different replicas always merge to the same result, with no coordination. → Conflict Resolution

D

Denormalization — Deliberately duplicating data across tables/documents to avoid joins at read time. Faster reads, harder writes, risk of inconsistency. → NoSQL Modeling

DNS (Domain Name System) — The distributed directory that turns example.com into an IP address. → DNS

Durability — Once the system says “saved,” the data survives crashes, power loss, and disk failure. Usually achieved by writing to a log on multiple machines before acknowledging. → Transactions

E

Edge — Infrastructure physically close to users (CDN PoPs, edge functions), as opposed to the “origin” datacenter. → CDN

Eventual consistency — If writes stop, all replicas eventually converge. Until then, different readers can see different values. → Consistency Models

Event sourcing — Store the immutable sequence of events that happened, and derive current state by replaying them, instead of storing only current state. → Event Sourcing

Exactly-once delivery — A guarantee that a message is processed precisely once. Strictly impossible in a distributed system with failures; what you actually build is at-least-once delivery plus idempotent processing. → Idempotency

F

Fan-out — Delivering one write to many places. Fan-out on write pushes a new tweet into every follower’s precomputed feed. Fan-out on read assembles the feed when the user opens the app. → News Feed

Fallacies of distributed computing — Eight false assumptions (network is reliable, latency is zero, bandwidth is infinite, …) that cause most distributed-systems bugs. → Fallacies

G

Geohash — Encoding a latitude/longitude pair into a short string where shared prefixes mean physical proximity, letting you do proximity search with ordinary string prefix queries. → Geospatial Indexing

Gossip protocol — Nodes randomly exchange state with a few peers; information spreads epidemically across the cluster without a central coordinator. → Gossip Protocols

gRPC — A high-performance RPC framework using HTTP/2 and Protocol Buffers. Common for service-to-service calls inside a datacenter. → gRPC

H

Head-of-line blocking — One slow item at the front of a queue delays everything behind it, even though those items could have been processed. → HTTP Versions

Heartbeat — A periodic “I’m alive” message. Missing heartbeats is how failure detectors decide a node is dead (sometimes wrongly). → Failure Modes

Hot key / hot partition — One key or shard receiving disproportionate traffic, saturating a single node while the rest of the cluster idles. → Hot Keys

Horizontal scaling (scaling out) — Adding more machines. → Scalability

I

Idempotency — An operation you can safely repeat with the same result. Essential because networks force retries. → Idempotency

Index — An auxiliary data structure that makes lookups fast at the cost of extra storage and slower writes. → Indexing

Inverted index — A map from each term to the list of documents containing it. The core of every search engine. → Search Systems

Isolation level — How much concurrent transactions can interfere: read uncommitted, read committed, repeatable read, serializable. → Isolation Levels

J

Jitter — Deliberate randomness added to retry delays so that retrying clients don’t all synchronize and hammer the server at the same instant. → Retries & Timeouts

JWT (JSON Web Token) — A signed, self-contained token carrying claims (user id, expiry, roles). Verifiable without a database lookup — which is also why revoking one is hard. → Sessions, JWT, OAuth

K

Kafka — A distributed, durable, partitioned log. Used for event streaming, decoupling services, and replayable pipelines. → Kafka

L

Latency — How long one operation takes. Usually reported as percentiles (p50, p95, p99), never as an average. → Performance Metrics

Leader election — Choosing one node to coordinate, and reliably choosing a new one when it dies. → Leader Election

Load balancer — Distributes incoming requests across many servers, checks their health, and removes dead ones. → Load Balancers

LSM-tree (Log-Structured Merge tree) — A storage engine that buffers writes in memory and flushes sorted files to disk, merging them in the background. Excellent write throughput; used by Cassandra, RocksDB, LevelDB. → Storage Engines

M

Message queue — A buffer between producer and consumer that decouples them in time, absorbs spikes, and enables retries. → Message Queues

Microservices — Splitting an application into independently deployable services. Solves organizational scaling; costs you network failures, distributed transactions, and operational overhead. → Monolith vs Microservices

MTTR / MTBF — Mean Time To Recovery / Mean Time Between Failures. Availability improves faster by reducing MTTR than by chasing MTBF. → Availability & Reliability

N

Non-functional requirementHow well the system must work: scale, latency, availability, consistency, durability, cost. These drive architecture more than features do. → Requirements Gathering

Normalization — Structuring relational data so each fact is stored exactly once. Clean writes, more joins on read. → Relational Modeling

O

Object storage — Store for large immutable blobs (images, video, backups), addressed by key, effectively unlimited and cheap. S3, GCS, Azure Blob. → Object Storage

Optimistic concurrency control — Don’t lock; instead check at commit time whether anyone else changed the row (via a version number), and retry if so. → Transactions

Origin — Your actual servers, behind the CDN. → CDN

P

PACELC — Extension of CAP: if Partitioned, choose Availability or Consistency; Else (normal operation), choose Latency or Consistency. More useful than CAP because systems are usually not partitioned. → CAP & PACELC

Partition (data) — A subset of your data living on one node. See sharding. → Sharding

Partition (network) — A network failure splitting the cluster into groups that can’t talk to each other. → Failure Modes

Percentile (p50/p95/p99) — p99 = 100 ms means 99% of requests finished in under 100 ms. The tail is what users actually complain about. → Performance Metrics

Protocol Buffers (protobuf) — Compact binary serialization with a schema. Smaller and faster than JSON, but not human-readable. → Serialization

Pub/Sub — Publishers emit messages to a topic; any number of independent subscribers receive them. → Message Queues

Q

QPS / RPS — Queries (or Requests) Per Second. The unit of scale in every estimation. → Back-of-the-Envelope

Quorum — A minimum number of nodes that must respond for an operation to count. With W + R > N you guarantee a read sees the latest write. → Quorums

R

Raft — A consensus algorithm designed to be understandable, used by etcd, Consul, CockroachDB, and TiKV. → Consensus

Rate limiting — Capping how many requests a client may make in a window, to protect the system and ensure fairness. → Rate Limiting

Read replica — A copy of the database that serves reads only, taking load off the primary. Data on it is slightly stale (replication lag). → Replication

Replication lag — The delay between a write on the primary and its appearance on a replica. Cause of “I posted a comment and it disappeared” bugs. → Replication

REST — An architectural style for HTTP APIs: resources as nouns, HTTP verbs for actions, stateless requests. → REST

S

Saga — A long-running business transaction split into local transactions, each with a compensating action to undo it if a later step fails. How you get “transactions” across microservices. → Saga Pattern

Serializability — The strongest isolation level: the result is as if transactions ran one at a time, in some order. → Isolation Levels

Sharding — Splitting data across multiple databases so no single machine holds it all. Buys you unlimited data scale; costs you cross-shard joins, transactions, and rebalancing pain. → Sharding

Sidecar — A helper container deployed alongside every service instance, handling cross-cutting concerns like mTLS, retries, and telemetry. → Service Mesh

SLI / SLO / SLA — Indicator (the metric you measure), Objective (your internal target), Agreement (the contractual promise with penalties). → SLO/SLA/SLI

Split-brain — Two nodes both believe they’re the leader after a partition, and both accept writes. Corruption follows. → Leader Election

Stateless service — A server that keeps no client-specific data between requests, so any instance can serve any request. Prerequisite for horizontal scaling. → Scalability

Sticky session (session affinity) — Routing a given user always to the same server. Simple, but it defeats even load distribution and breaks when that server dies. → Load Balancers

Strong consistency — Every read sees the most recent write. Requires coordination, which costs latency and availability. → Consistency Models

T

Tail latency — The slow end of the distribution (p99, p99.9). At scale, one user request may touch 100 services, so the p99 of each becomes the typical experience of a page. → Performance Metrics

Throughput — Operations completed per unit time. Distinct from latency: a system can have high throughput and terrible latency. → Performance Metrics

Timeout — The maximum time you’ll wait for a response. Every network call must have one. A missing timeout is the most common cause of cascading outages. → Retries & Timeouts

Two-phase commit (2PC) — A protocol for atomic commit across multiple databases: prepare, then commit. Blocks if the coordinator dies. → Distributed Transactions

U

Upsert — Insert if absent, update if present. A single atomic operation, and a common building block for idempotent writes. → Idempotency

V

Vector clock — A per-node counter set that lets you tell whether two versions of data are causally ordered or genuinely concurrent (a real conflict). → Conflict Resolution

Vertical scaling (scaling up) — Making one machine bigger. Simplest option, and correct far more often than beginners assume. → Scalability

Virtual node (vnode) — Placing each physical node at many points on the consistent-hashing ring, so load spreads evenly. → Consistent Hashing

W

WAL (Write-Ahead Log) — Append changes to a durable log before applying them. The mechanism behind crash recovery, replication, and CDC. → Storage Engines

Warm-up / cache warming — Pre-populating a cache before traffic arrives, so the first users don’t all pay for cache misses. → Caching

WebSocket — A persistent, bidirectional connection over a single TCP connection. Used for chat, live updates, and multiplayer. → Realtime Communication

Write amplification — One logical write causing several physical writes (index updates, LSM compaction, replication). → Storage Engines

Z

ZooKeeper — A coordination service providing distributed locks, leader election, configuration, and service discovery, built on a consensus protocol (ZAB). → Coordination Services


Units and numbers you should recognize instantly

Symbol Means Scale example
ms millisecond, 10⁻³ s A datacenter round trip is ~0.5 ms; a cross-continent one is ~150 ms
µs microsecond, 10⁻⁶ s An SSD read is ~100 µs
ns nanosecond, 10⁻⁹ s An L1 cache reference is ~1 ns
KB / MB / GB / TB / PB 10³ / 10⁶ / 10⁹ / 10¹² / 10¹⁵ bytes A tweet ~300 B; a photo ~2 MB; a 1080p movie ~4 GB
K / M / B thousand / million / billion 1 M requests/day ≈ 12 QPS average

Memorize the latency table in Latency Numbers. It comes up constantly.