System Design Handbook

From Building Blocks to Complex Architectures — Interview Prep & Real-World Reference
📐 12 Sections 🔧 50+ Patterns 🎯 Interview Ready 📡 Real-World Systems
⬇️ Download HTML
01 Building Blocks
The fundamental components every distributed system is built from. Master these before tackling complex architectures.
🌐 Load Balancers
Layer 4 (TCP) HAProxy

Routes by IP/port. Faster, less overhead. Good for simple TCP traffic. Cannot inspect HTTP headers for smart routing.

Layer 7 (HTTP) NGINX

Routes by URL path, headers, cookies. Slower per-request but enables content-based routing, SSL termination, rate limiting.

DNS Load Balancing Round-robin

Returns multiple IPs for one hostname. Simple but no health awareness — clients may hit dead servers until DNS TTL expires.

Load Balancer Topology
Users
LB
⬇ ⬇ ⬇
App 1
App 2
App N
🗄️ Databases
Relational (SQL) PostgreSQL

ACID transactions, joins, schema enforcement. Best for financial data, user accounts, inventory where consistency matters.

Document (NoSQL) MongoDB

Flexible schema, fast reads on primary key. Best for content catalogs, user profiles, IoT telemetry. Trade-off: no JOINs, weaker consistency.

Key-Value Redis

In-memory, microsecond latency. Best for caching, session storage, real-time leaderboards. Data must fit in RAM.

📨 Message Queues
Kafka Log-based

Append-only log, persists to disk. Best for event streaming, log aggregation, clickstreams. Replays possible. Higher throughput but higher latency.

RabbitMQ Queue-based

Smart broker, routing keys, exchanges. Best for task queues, RPC, workloads needing complex routing. Lower throughput than Kafka.

SQS / PubSub Managed

Fully managed, auto-scaling. SQS for simple queues, PubSub for pub/sub fan-out. No broker to manage. Vendor lock-in consideration.

📦 Storage
Object Storage S3

Store blobs (images, videos, backups). 11 nines durability, cheap. Eventual consistency (read-after-write for PUT of new objects only).

Block Storage EBS

Raw disk volumes attached to a VM. Low latency, persists independently. Used for databases, file systems. Limited to single-instance mount.

File Storage EFS

Shared NFS across instances. POSIX permissions. Good for shared file systems, media processing workflows. Higher latency than block.

🔌 API Design
StyleBest ForTrade-offs
RESTCRUD APIs, resource-orientedOver-fetching/under-fetching, multiple round-trips
GraphQLComplex queries, mobile clientsHard to cache, N+1 problem, complex rate limiting
gRPCService-to-service, streamingBinary protocol (hard to debug), HTTP/2 required
WebSocketReal-time bidirectionalStateful — hard to scale horizontally
02 Key Concepts
Foundational theoretical concepts that drive architectural decisions in distributed systems.
🔺 CAP Theorem
CAP: A distributed system can only provide two of three guarantees: Consistency, Availability, Partition Tolerance.
CP Consistency + Partition

Sacrifice availability during partitions. All nodes return same data or error. Examples: Zookeeper, etcd, HBase.

AP Availability + Partition

Sacrifice consistency during partitions. Nodes accept writes & return stale reads. Examples: Cassandra, DynamoDB, Riak.

CA Consistency + Availability

Sacrifice partition tolerance. Cannot survive network splits. Examples: Single-node RDBMS.

🔄 PACELC Theorem
PACELC: CAP + trade-offs during normal operation: If Partition (P) → choose A or C. Else (E) → choose L (Latency) or C (Consistency).

DynamoDB: PA/EL (available during partitions, eventually consistent normally). Cassandra: PA/EL. MongoDB: CP/EC (consistent during partitions, consistent normally).

🎯 Consistent Hashing
How it works

Maps both nodes and keys onto a hash ring. Each key is assigned to the next clockwise node. Adding/removing a node only reshuffles keys on its immediate neighbors — not the whole ring.

Virtual Nodes

Each physical node is represented by N virtual nodes on the ring. Prevents hot spots — a heavy key range is spread across physical nodes. Trade-off: more metadata to store.

🚦 Rate Limiting
AlgorithmProsCons
Token BucketBurst-friendly, simpleMemory per user, needs tuning
Leaky BucketSmooth output, constant rateNo bursts allowed
Sliding Window LogPrecise, no boundary spikesO(N) memory per user (timestamps)
Sliding Window CounterMemory-efficient, precise enoughSlightly less accurate than log
🔗 Idempotency
Key Insight: An operation is idempotent if executing it multiple times has the same effect as executing it once. Crucial for retries in distributed systems where network failures hide the actual outcome.

Implementation strategies: idempotency key (client-generated UUID in header), idempotent PUT (replace resource), idempotent DELETE (succeed even if already deleted). Payment APIs must be idempotent — never charge twice.

03 Design Patterns
Reusable architectural patterns that solve recurring distributed system problems.
🏛️ Microservices

Decompose app into small, independent services. Each owns its data, communicates via API. Scales independently, enables polyglot tech stacks. Trade-off: distributed complexity, network latency, data consistency challenges.

🏗️ Event-Driven

Services communicate via events (Kafka, EventBridge). Decoupled producers/consumers. Excellent for async workflows, audit trails. Can be hard to debug (event flow across many services).

📋 CQRS Command/Query Segregation

Separate read models from write models. Reads use optimized views (denormalized, cached), writes go through domain logic. Enables different scaling for reads vs writes. Adds eventual consistency complexity.

⏳ Saga Pattern

Chain of local transactions, each publishing events for the next step. On failure, execute compensating transactions. Choreography: each service listens and acts. Orchestration: central coordinator manages flow.

⛓️ Circuit Breaker

Wrapper around a remote call. After N failures, trips to OPEN state (fast-fail). After timeout, goes HALF-OPEN to test recovery. Prevents cascading failures, gives downstream time to recover.

🚧 Bulkhead

Isolate resources (thread pools, connections) per service/endpoint. A failure in one bulkhead can't consume resources from another. Ship compartments analogy — one flooded section doesn't sink the whole ship.

🌿 Strangler Fig

Gradually replace a monolithic system by routing specific functionality to new microservices. Old and new coexist. Eventually the monolith is "strangled" — all traffic goes to new services.

📡 Event Sourcing

Store all state changes as an append-only event log. Current state = replay all events. Enables audit trail, time travel, full rebuild. Storage grows unbounded — compaction/snapshots needed.

Pattern Decision Matrix
ProblemPatternWhen To Use
Monolith too largeStrangler FigCan't rewrite, need incremental migration
Service depends on failing downstreamCircuit BreakerExternal APIs, microservice calls
High read/write imbalanceCQRSReporting, dashboards vs transactional writes
One failure eats all resourcesBulkheadShared thread pools, connection pools
Distributed transaction neededSagaMulti-service order fulfillment, booking
Async decoupling neededEvent-DrivenNotifications, analytics pipeline
Common Microservices Architecture
API Gateway
Auth
Users
Orders
Payments
⬇ message bus
Analytics
Notifications
Search Index
04 Database Deep Dive
Database architectures, replication, sharding, and choosing the right data store for the job.
SQL vs NoSQL Decision Matrix
FactorSQLNoSQL
SchemaFixed, enforcedFlexible, optional
ACID TransactionsFull supportLimited or none
JoinsNative, efficientApplication-side only
Horizontal ScaleHard (sharding complex)Built-in
Query FlexibilitySQL — rich queriesLimited by data model
Read PerformanceGood with indexesExcellent (key lookup)
Write ThroughputLimited by single nodeLinear scaling
Replication Strategies
Single Leader Most Common

One primary (writes), N replicas (reads). Async: possibly stale reads. Sync: slower writes but consistent reads. Handles read scaling well, writer is bottleneck.

Multi-Leader Cross-region

Multiple nodes accept writes. Each replicates to others. Used in multi-DC deployments. Conflict resolution needed (last-write-wins, CRDTs, custom merge).

Leaderless Dynamo-style

All nodes accept reads/writes (Cassandra). Quorum: R + W > N for consistency. Tunable: specify R and W per operation. Highest availability, lowest consistency.

📊 Sharding (Horizontal Partitioning)
Hash-based

Hash shard key → look up range. Even distribution, but range queries hit all shards. Re-sharding requires moving data (consistent hashing helps).

Range-based

Data divided by key ranges (A-M, N-Z). Good for range scans, but hot spots if keys are not uniformly distributed (timestamps).

Sharding Challenges: Cross-shard queries (fan-out), joins across shards, secondary index maintenance, atomic operations across shards, resharding without downtime.
Indexing
Index TypeBest ForCost
B-TreeRange queries, equality, sortingO(log N), default for most DBs
HashPoint lookups (exact match)O(1), no range queries
BitmapLow cardinality columns (gender, status)Efficient for AND/OR of enums
InvertedFull-text searchLarge index, slow writes
LSM-TreeWrite-heavy workloadsWrite-optimized, read amplification
05 Real-World Systems
How these patterns combine in actual large-scale systems. Study these end-to-end to prepare for system design interviews.
🔗 URL Shortener (TinyURL)

Core requirement: Shorten long URLs, redirect via 301/302. Scale: 100M URLs/day.

Key decisions: Base-62 encoding for short keys (7 chars = 3.5T combos). Write to DB (PostgreSQL/AWS Aurora), read from cache (Redis). Pre-generate keys to avoid collisions. 301 for permanent redirect (browser caches), 302 for analytics tracking.

Architecture: API Gateway → URL Service (generate/store) → DB + Cache. Redirect: Cache → fallback DB. Analytics: async Kafka → ClickHouse/AWS Athena.

💬 WhatsApp / Chat System

Core requirement: Real-time messaging, 2B+ users, delivery status, media sharing. Key challenges: End-to-end encryption, low latency, exactly-once delivery.

Architecture: WebSocket for real-time delivery. Message stored in Cassandra (write-optimized). Media goes to object store (S3/CDN). Presence via Redis. Group chats fan-out: small groups → fan-out on write; large groups → fan-out on read (pull model).

Delivery semantics: Each message gets a server-assigned ID. Client acks via sequence numbers. Missed messages synced on reconnection.

▶️ YouTube / Video Streaming

Core requirement: Upload, process, and stream videos at scale. 500h/minute uploaded.

Pipeline: Upload → object store (S3) → encoding queue (Kafka + workers) → segmented storage (DASH/HLS: .ts segments at multiple bitrates). CDN serves segments to viewers.

Key patterns: Async upload pipeline (durability > speed). Adaptive bitrate (client switches quality based on bandwidth). Pre-warm popular content on CDN edge. Geo-distributed caching — serve from nearest POP.

🚗 Uber / Ride Hailing

Core requirement: Match riders with nearby drivers in real-time, handle surge pricing, ETA prediction.

Key challenge: Geospatial indexing (find drivers within 1 mile of rider). Solution: Geohash / QuadTree / S2 Geometry. Each cell in grid has list of active drivers.

Architecture: Rider app → dispatch service (geospatial index) → match service → driver app. Kafka for ride lifecycle events. Redis for real-time driver locations (5s heartbeat). Google S2 Library for geohash. Surge pricing: demand/supply ratio per geohash cell, recalculated every N minutes.

🐦 Twitter / Social News Feed

Core requirement: 500M tweets/day, show relevant tweets from followed users. Key decision: Fan-out on write (pre-compute timeline) vs fan-out on read (compute on request).

Hybrid approach: Active users (majority): fan-out on write → pre-populated timeline in Redis sorted set (latest tweet IDs). Celebrities: fan-out on read (too many followers to write to each).

Storage: Tweet content → Cassandra (keyed by tweet ID). Timeline → Redis (sorted sets, per user). Social graph → FlockDB/Graph DB (follows/followers). Search → Elasticsearch.

📦 Amazon / E-commerce

Core requirement: 300M+ customers, 350M+ products. Product catalog, shopping cart, order processing, payment, fulfillment.

Architecture (SOA → Microservices): Product Service, Cart Service, Order Service, Payment Service, Recommendation Engine. Each service owns its data store. Async via SQS/Kafka for decoupled workflows (payment → fulfillment → shipping).

Key patterns: CQRS (read product catalog from denormalized views). Event Sourcing (order state changes as event stream). Materialized Views (product search index). Read replicas for catalog (read-heavy).

06 Scalability & Reliability
Making systems handle growth and survive failures.
Scaling Strategies
ApproachWhatWhenLimits
VerticalBigger machine (more CPU/RAM)Quick fix, simple appsHardware cap, expensive at scale
HorizontalMore machines behind a load balancerStateless apps, web tierState management complexity
ShardingSplit data across DB instancesDB write throughput limitCross-shard queries, resharding
Read ReplicasAsync replicas for read scalingRead-heavy workloadsStale reads, replication lag
CachingStore hot data in faster layerRead-heavy, repetitive queriesCache invalidation, stale data
🛡️ Reliability Patterns
Health Checks

Readiness probe (is service ready for traffic?) + Liveness probe (is service alive?). LB auto-detaches unhealthy instances.

Graceful Degradation

When a dependency fails, degrade the feature rather than show an error. E.g., show cached recommendations if ML service is down.

Chaos Engineering

Proactively inject failures (kill instances, add latency, network partitions) to verify the system recovers. Netflix Chaos Monkey is the canonical example.

📈 Observability (The Three Pillars)
📊 Metrics

Aggregated numerical data. Latency (p50/p99), error rate, throughput, saturation. Prometheus + Grafana.

📝 Logs

Structured log events with severity, correlation IDs, and context. ELK Stack (Elastic, Logstash, Kibana) or Loki for log aggregation.

🔍 Traces

End-to-end request lifecycle across services. OpenTelemetry + Jaeger/Zipkin. Shows where time is spent and where errors occur.

Debugging at scale: Correlation IDs (propagated via headers) link logs + traces + metrics for a single request across 20+ microservices. Without them, debugging is almost impossible.
07 Distributed Systems
Classic distributed systems concepts — consensus, clocks, transactions across nodes.
🤝 Consensus Algorithms
Paxos

Theoretical foundation. Proposer → Acceptors → Learners. Two phases: prepare (promise) and accept (commit). Correct but famously hard to implement correctly.

Raft

Designed for understandability. Leaders, logs, term numbers. Leader election (heartbeats + timeouts). Log replication (leader pushes to followers). Etcd, Consul use Raft.

Zab (Zookeeper)

Leader-based, atomic broadcast order. Used by Zookeeper for coordination. Global leader election via FastLeaderElection. ZXID for ordering.

🕰️ Distributed Transactions
PatternConsistencyPerformanceComplexity
2PC (Two-Phase Commit)StrongSlow (blocking)Medium
3PC (Three-Phase Commit)StrongSlowerHigh
SagaEventualFastMedium
2PC + CompensationStrong eventualMediumHigh
🕒 Clock & Ordering
Lamport Clocks

Logical counters: each node increments on events. C(a) < C(b) means a happened before b. But C(a) < C(b) and C(b) < C(a) means concurrent — no causality info.

Vector Clocks

Each node tracks its view of all others' clocks. V(a) < V(b) (all components ≤) means causal relationship. Incomparable vectors = concurrent changes (conflict detection). Used in Dynamo/Cassandra.

🔒 Distributed Locking
Redlock debate (Martin Kleppmann vs Redis authors): Redlock (Redis-based distributed lock) has no fencing guarantee — client can be paused holding a lock, lock expires, another client acquires it, original client resumes and acts on stale lock. Solution: fencing tokens (monotonically increasing sequence number checked on the resource side).
08 Caching & CDN
Caching strategies, cache invalidation, and content delivery networks to reduce latency and database load.
Caching Strategies
StrategyHow It WorksBest Use
Cache-AsideApp checks cache first. Miss → read from DB → populate cache.Read-heavy workloads, general purpose
Read-ThroughCache is authoritative. Cache reads from DB on miss.When cache can manage its own DB fallback
Write-ThroughWrite to cache, cache writes to DB synchronously.Read consistency + write reliability
Write-BehindWrite to cache immediately, async write to DB.Write-heavy, can tolerate DB lag
Write-AroundWrite directly to DB, invalidate cache. Next read populates.Write-once, read-rarely data
⛔ Cache Invalidation
"There are only two hard things in computer science: cache invalidation and naming things." — Phil Karlton
TTL Expiry

Simplest: set a time-to-live. Cache auto-expires. Trade-off: stale data until TTL expires. Best for data that tolerates staleness (profiles, product catalogs).

Write-Invalidate

On write, delete the cached entry. Next read repopulates. Simple but creates "cold start" on each write.

Write-Update

On write, update both DB and cache atomically. Consistent but more complex — cache write can fail separately from DB write.

🌍 CDN (Content Delivery Network)

How CDNs work: Geo-distributed proxy servers cache static content (images, CSS, JS, video) at edge locations closest to users. User DNS resolves to nearest edge server (via anycast or GeoDNS).

Key concepts: Pull CDN (edge fetches from origin on cache miss — simpler) vs Push CDN (origin uploads content to CDN nodes). Cache hit ratio = percentage of requests served from edge (90%+ is good). Tiered caching: L1 (edge) → L2 (regional) → origin.

Popular CDNs: CloudFront (AWS), Cloudflare, Akamai, Fastly. Key differentiators: edge compute (Cloudflare Workers, Lambda@Edge) for dynamic content at the edge.

09 Interview Framework
A repeatable 4-step framework to tackle any system design interview question.
4
Steps
15m
Clarify + Scope
10m
High-Level Design
15m
Deep Dive
5m
Summary
The 4-Step Interview Framework
1. Clarify
2. HLD
3. Deep Dive
4. Wrap
Step 1: Clarify Requirements

Functional: What does the system do? "Design Twitter" → post tweets, follow users, view timeline, search. Ask specifically about features — don't assume.

Non-functional: DAU/MAU estimate, latency (real-time vs eventual), consistency requirements, durability (data loss acceptable?), availability SLA.

Scale: "How many users?" "How many writes per day?" "How many reads per write?" Estimate traffic before designing.

Constraints: Budget, team size, timeline? (Unlikely to matter in interviews but worth asking.)

Step 2: High-Level Design (HLD)

Draw the boxes: Client → CDN/API Gateway → Load Balancer → Web Tier (stateless) → App Tier → Data Tier.

Data flow: Trace the primary user flow. "User posts a tweet → goes to API → write to DB → fan-out to followers → cache updated."

Choose the right data stores: PostgreSQL for transactions, Cassandra for write-heavy, Redis for caching, S3 for blobs, Elasticsearch for search.

Mention key technologies by name: "Kafka for async decoupling, Redis sorted sets for timeline, Cassandra for tweet storage."

Step 3: Deep Dive on 1–2 Components

Pick the hardest part: For Twitter → "Let's deep dive on the timeline generation. Fan-out on write for active users, fan-out on read for celebrities. Here's how Redis sorted sets work..."

Trade-offs: "Fan-out on write means faster reads but N writes per tweet. That's why we cap followers at 500 for pre-computation and handle the rest at read time."

Scale numbers: "With 500M tweets/day = ~6K writes/second. Timeline reads: 400M DAU reading ~30 timelines/day = 140K reads/second. We need Redis cache (100M timelines fits in ~200GB RAM)."

Step 4: Summary & Alternatives

Summarize: "We designed a Twitter-like system using hybrid fan-out, Redis timeline cache, Cassandra for durable storage, Kafka for async processing."

What would you change for different constraints? "If consistency was critical, I'd use PostgreSQL instead of Cassandra. If we had fewer resources, I'd start with a monolith and extract services one by one (Strangler Fig)."

Alternative approaches: "An alternative is fully serverless — API Gateway + Lambda + DynamoDB for the MVP. Scales automatically, zero ops, but higher per-request cost at scale."

10 Estimation & Trade-offs
Back-of-envelope calculations and a taxonomy of architectural trade-offs to discuss in interviews.
📐 Back-of-Envelope Reference Numbers
OperationTimeNotes
L1 cache reference0.5 nsCPU level 1 cache
RAM access100 nsMain memory
SSD random read150 μs≈ 1000× slower than RAM
Disk seek10 msHDD — avoid for random reads
Redis in-memory get500 μsNetwork + round-trip
PostgreSQL query (indexed)5–20 msDepends on data size
Full table scan (1M rows)500 msOnly for analytics, never in path
HTTP API call (service-to-service)50–200 msIncludes serialization, network
Disk sequential write50 MB/sHDD; SSD ≈ 500 MB/s
Network: same DC0.5 msWithin a data center
Network: cross-region50–100 msUS West → Europe
⚖️ Common Trade-off Dimensions
Trade-offChoose A if...Choose B if...
Consistency vs AvailabilityFinancial transactions, inventoryContent delivery, social feeds
Latency vs ThroughputReal-time chat, gamingBatch processing, analytics
Monolith vs MicroservicesSmall team, simple domainLarge team, independent deploy needed
SQL vs NoSQLJoins, ACID, complex queriesScale, flexible schema, high write throughput
Push vs Pull (event delivery)Real-time needed, small consumer countMany consumers, variable load
Sync vs Async processingImmediate result neededUser doesn't need to wait
📊 Capacity Estimation Example: URL Shortener
# 100M URLs/day = ~1200 writes/sec # Read:Write ratio = 100:1 = ~120K reads/sec # Storage for 10 years: # 100M * 365 * 10 = 365B URLs # Each URL: shortKey(7B) + original(500B avg) + created(8B) = ~515B # Total: 365B * 515B ≈ 188 TB # Bandwidth: reads = 120K/s * 600B response ≈ 72 MB/s # Cache: top 20% URLs get 80% traffic (Pareto) # 120K reads/s * 20% = 24K/s from cache # Need Redis cluster handling 24K OPS (one ~100K r/s node suffices)
11 System Design Q&A
Common interview questions with structured answers covering architecture, trade-offs, and scale.
Design a distributed key-value store

Approach: Inspired by DynamoDB/Cassandra. Consistent hashing on the key ring, each node responsible for a range. Replication factor 3 → each key stored on 3 consecutive nodes. Read quorum (R=2), Write quorum (W=2) for strong consistency. Hinted handoff for temporary failures (neighbors accept writes until node recovers). Merkle trees for anti-entropy (detect and repair inconsistencies).

Trade-offs: Eventual consistency by default, tunable for stronger guarantees (R+W > N). Write is fast (no coordinator). Complexity: node addition/removal triggers data migration.

Design a rate limiter

Approach: Token bucket per user/IP/API key. Redis sorted sets for sliding window. Lua script in Redis for atomic increment + TTL. Distributed: use Redis cluster, consistent hashing by user ID so each user's counter is on one node.

Error handling: 429 Too Many Requests with Retry-After header. Client throttling (local cache of remaining quota from X-RateLimit-* headers).

Storage estimate: For 100M users tracking 1 bucket each: 100M * (userID + counter + TTL) ≈ 5GB in Redis. Trivially fits on one node with replication.

Design a notification system

Approach: Notification Service (API) → Preference Service (filter by channel/opt-in) → Channel Workers (Email, SMS, Push, In-App). Kafka between stages for decoupling and durability.

Key challenges: Delivery guarantees: at-least-once (dedup via idempotency keys). Batching: aggregate notifications per user ("3 new likes" not "like, like, like"). Template rendering: notification templates + user-specific variables (pre-rendered vs on-demand).

Scale: 10M push notifications/day → ~120/s, easily handled by a few workers. Email and SMS are slower (third-party APIs), so queue depth matters — monitor and scale workers.

Design a web crawler

Approach: URL Frontier (priority queue) → DNS Resolver → Fetcher (HTTP client) → Parser → Link Extractor → Content Storage. RabbitMQ/Kafka for frontier URL distribution among fetchers.

Politeness: Rate-limit per domain (don't hammer a single site). Robots.txt compliance. Cache DNS lookups (aggressive DNS rate is a problem).

Deduplication: URL seen set (Bloom filter + RocksDB for persistence). 10B URLs → Bloom filter with 1% false positive: ~12GB memory. Canonicalize URLs (normalize trailing slashes, lowercase scheme/host).

Design a proximity / nearby service

Approach: Geohash / QuadTree / S2 Geometry. Geohash: encode lat/lng into string, same prefix = nearby. Query adjacent geohash cells. S2 (used by Google/Uber): 64-bit integer cell IDs, hierarchical spatial indexing.

Data model: Redis GEOADD (for real-time locations with expiry). Or: Cassandra with geohash as partition key (for persistent location history).

Federated approach: Partition the world into grid cells. Each cell's data lives on a shard. Growing cell (city center) → subdivide into smaller cells. Read: given user's lat/lng → find cell → query cell's shard.

12 Glossary
Key terms and concepts every system design engineer should know. Use this for quick reference and interview flashcard review.

ACID

Atomicity, Consistency, Isolation, Durability. Properties of database transactions. Ensures reliable processing even with failures.

databasetransactions

BASE

Basically Available, Soft state, Eventual consistency. The NoSQL alternative to ACID — relaxed consistency for higher availability.

databasenoSQL

Bloom Filter

Probabilistic data structure. Tells you "definitely not in set" or "maybe in set." Space-efficient for dedup at scale. False positives possible, never false negatives.

data structure

CDN

Content Delivery Network. Geo-distributed proxy servers that cache and serve static content from edge locations closest to users. Reduces latency and origin load.

networking

CLH

Consistent Hashing. Distributes keys across nodes with minimal reshuffling when nodes join/leave. Uses a hash ring and virtual nodes for balance.

distributed

CRDT

Conflict-free Replicated Data Type. Data structure that converges automatically across replicas without coordination. Examples: Grow-only Counters, LWW-Register, OR-Set.

distributed

Gossip Protocol

Each node periodically tells others what it knows. Over time, all nodes converge. Used for failure detection, membership (Cassandra), and state dissemination.

distributed

HDFS

Hadoop Distributed File System. Splits files into large blocks (128MB), replicates across nodes. Designed for batch processing, not low-latency access.

storage

HSM

Hot, Warm, Cold storage tiers. Data moves based on access frequency. Reduces cost — frequently accessed (hot) on fast storage, archival (cold) on cheap object storage.

storage

Leader Election

Process by which distributed nodes choose one as the leader. Leaders handle writes, coordination. Zookeeper/etcd use Paxos/Raft for this.

distributed

MapReduce

Programming model for distributed data processing. Map (transform/filter) → Shuffle (sort/group) → Reduce (aggregate). Used by Hadoop, Spark (more general).

processing

P99 Latency

The 99th percentile latency — 99% of requests complete at or below this time. Critical SLO metric; the "tail at scale" problem (one slow request slows many).

observability

Quorum

Minimum number of nodes that must agree on a read/write in a distributed system. R + W > N for strong consistency. Higher quorum = slower but more consistent.

distributed

Sharding

Splitting a database across multiple nodes (horizontal partitioning). Each shard holds a subset of the data. Enables write scaling. Complex: joins, rebalancing, hot spots.

database

SPOF

Single Point of Failure. A component whose failure causes the entire system to fail. Eliminated through redundancy, load balancing, and failover mechanisms.

reliability

Thundering Herd

When many clients simultaneously request a resource that just expired from cache, causing a stampede to the origin. Solution: lock/mutex around cache repopulation, pre-warming.

caching

System Design Handbook — Building Blocks to Complex Architectures

Built for interview prep and real-world reference. Last updated July 2026.

⬇️ Download HTML