81 system design articles and interactive examples
SCALEWIKI
Explore how systems scale, from the CAP theorem to consensus algorithms. Work through design tradeoffs, interactive examples and educational case studies informed by public engineering sources.
Practice a decision, then explore the mechanism
ScaleWiki is a learning reference for distributed systems. Use the diagrams to follow a request, read the design exercises to compare failure paths, and change the assumptions in the capacity lab to see how sizing decisions move. The editorial notes explain how sources are used, what AI-assisted editing means here, and how to report a correction.
Start with a concrete question: can the database handle a cold cache, what happens when a write is retried, or which replicas can safely answer during a partition? Each question leads to different constraints. A product name alone cannot choose your architecture.
Company-inspired exercises are hypothetical designs, not claims about a company’s private infrastructure. Numerical examples are illustrative unless a linked source explicitly says otherwise.
Worked Design Exercises
Hypothetical services with explicit workloads, failure cases and design tradeoffs.
Chat Delivery: Durable Acknowledgments and Device Sync
Design a chat workflow with retry-safe message IDs, per-device receipts, offline queues and explicit encryption boundaries.
File Synchronization: Versions, Conflicts and Recovery
A worked file-sync design: immutable blocks, version checks, offline conflicts, and safe cleanup. Includes a clearly scoped Dropbox engineering reference.
Notification Delivery: Queues, Retries and Deadlines
Design a notification service around provider acceptance, recipient delivery, retry ambiguity, queue age and changing preferences.
Payment Workflows: Idempotency, Ledgers and Reconciliation
Trace a payment through an ambiguous timeout, concurrent retries, balanced ledger entries and evidence-based reconciliation.
Ride Matching: Spatial Search and Safe Assignment
Work through stale locations, geographic candidate selection, concurrent driver offers and fenced trip assignments.
Social Feed Design: Fan-out, Ranking and Privacy
Work through a hybrid social-feed design, estimate write amplification, and handle deletion, privacy changes and stable pagination.
Ticket Booking: Durable Holds and Concurrent Checkout
A worked seat-booking design that prevents stale holds from becoming sales and handles payment completion after expiry.
URL Shortener: Allocation, Redirects and Revocation
Design short-link allocation with collision handling, explicit redirect caching, safe revocation and realistic storage estimates.
Video Processing: Resumable Uploads and Atomic Publication
Work through a video pipeline with durable uploads, repeatable encoding tasks, aligned renditions and safe manifest publication.
Video Streaming: CDN Capacity and Playback Recovery
Separate documented Open Connect facts from a worked streaming design, with bandwidth estimates, adaptive bitrate decisions and outage scenarios.
Web Crawler: Politeness, Scope and Reliable Progress
Build a bounded crawler with per-origin scheduling, robots handling, conservative URL normalization and recoverable fetch state.
Core Principles
The building blocks of distributed systems.
Backpressure: Bound Work Before It Becomes a Backlog
Calculate queue growth, propagate bounded demand, and choose an explicit overflow policy using a runnable asynchronous queue example.
Caching Overview
Estimate cache benefits and cold-cache risk, choose a cache boundary, and test freshness and failure behavior.
Caching Strategies
A breakdown of where to place your cache and how to keep it in sync with your database.
CAP Theorem
Reason about a network partition using a reservation example, quorum limits and operation-specific consistency choices.
Circuit Breaker Pattern
A mechanism to prevent an application from repeatedly trying to execute an operation that's likely to fail.
Consistent Hashing
How to add/remove servers without moving every single key. The ring, virtual nodes, placement and migration tradeoffs.
Heartbeat Protocol
A mechanism for failure detection in distributed systems where nodes send periodic signals to indicate they are still alive. Implementation strategies, timeout tuning, and production patterns.
Horizontal Scaling (Scaling Out)
How adding nodes changes capacity, data distribution, and coordination, with bottleneck estimates and scale-out trade-offs.
Load Balancing
Layer 4 vs Layer 7 Load Balancing. Algorithms (Round Robin, Least Connections, Consistent Hashing). Health checks and real-world implementation with Nginx.
Proxies: Forward vs Reverse
Understanding proxy servers that act as intermediaries between clients and servers, including forward proxies for controlled client egress and reverse proxies for load balancing, security, and caching.
Rate Limiting
Traffic control mechanism that limits the number of requests a user can make to prevent abuse, ensure fairness, and protect system resources from overload.
Scaling: Overview
A practical guide to scaling up and out, testing database and cache bottlenecks, and estimating failure headroom from measured workload rather than user counts.
Vertical Scaling (Scaling Up)
How adding resources to one machine affects capacity, cost, hardware limits, and failure exposure.
Distributed Algorithms
Data structures and consensus protocols for scale.
Bloom Filters: Size, False Positives and Safe Use
Calculate the memory budget, run a bit-packed example, and understand when a probabilistic membership check must defer to an authoritative store.
Distributed Unique ID Generation
How to generate unique IDs in a distributed system without coordination. Twitter Snowflake, UUID v4 vs v7, Clock skew issues, and production implementations.
Geohashing (Location Encoding)
A geocoding system that encodes latitude/longitude coordinates into short alphanumeric strings for efficient proximity searches and spatial indexing.
Gossip Protocol
How peers propagate membership and state updates, and how fanout, partitions, expiry and repair affect convergence.
HyperLogLog (Cardinality Estimation)
A probabilistic algorithm for counting unique items in massive datasets using minimal memory, with tunable statistical error and compact mergeable state.
Leader Election
How distributed systems choose a coordinator, and how terms, leases, quorums, and fencing help prevent conflicting leaders.
Merkle Trees (Data Synchronization)
Hash tree data structure enabling efficient verification of data integrity and synchronization across distributed systems, used in Git, Bitcoin, Cassandra, and IPFS for tamper detection and incremental sync.
Quadtrees (Location Based Services)
Spatial data structure recursively subdividing 2D space into four quadrants, supporting region searches with explicit limits for clustered points, geographic coordinates, and query size.
Raft Consensus Algorithm
Raft consensus explained through leader election, log replication, commitment, safety guarantees, and operational trade-offs.
Token Bucket vs Leaky Bucket
Compare token bucket and leaky bucket behavior, including burst capacity, refill rate, queueing, and traffic shaping.
Top-K Heavy Hitters (Streaming)
How to find 'Trending Topics' in massive real-time streams. MapReduce, Count-Min Sketches, and Sliding Windows.
Trie (Prefix Tree & Autocomplete)
A tree data structure optimized for storing and searching strings by prefix, enabling efficient autocomplete, spell checking, and dictionary operations in O(L) time.
Data & Storage
Databases, replication, and storage engines.
CRDTs (Real-time Collaboration)
How convergent data types merge offline changes, why removals need causal metadata, and how to test collaboration semantics without assuming business invariants are automatic.
Database Indexing
How B-tree indexes, clustered and secondary layouts, composite keys, and covering indexes affect lookups and write cost.
Database Replication
The process of copying and maintaining database objects in multiple databases to improve reliability, fault-tolerance, and accessibility.
Database Sharding
How to split a massive database across multiple servers. Horizontal scaling strategies, challenges (Joins, ACID), and real-world algorithms used by Instagram, Vitess, and CockroachDB.
Distributed File Systems
How distributed file systems split files into blocks and manage metadata, replication, locality, and node failures, using HDFS as an example.
Document Databases
A common type of NoSQL database. Storing data in flexible, JSON-like documents with embedded structures and dynamic schemas.
Event Sourcing & CQRS
How event logs support state reconstruction and audit history, and how CQRS separates command handling from query models.
Graph Databases
How property graphs represent nodes, relationships, and properties, and how traversal queries compare with relational joins.
LSM Trees (Database Internals)
How log-structured merge trees batch writes into sorted files and trade immediate updates for compaction work.
Redis Internals: Why is it Fast?
How Redis's command loop, pipelining, data structures and persistence settings shape latency and recovery tradeoffs.
SQL vs NoSQL: The Database Guide
Compare relational and non-relational data models by query patterns, transaction guarantees, consistency needs, and operational trade-offs.
Vector Databases (AI/Embeddings)
How vector search indexes embeddings with approximate nearest-neighbor methods such as HNSW and IVF, and which trade-offs affect retrieval.
Network & Communication
Protocols, APIs, and messaging.
Apache Kafka Architecture
Understanding the internals of the event streaming platform. Topics, Partitions, Offsets, Consumer Groups, and the transition from ZooKeeper to KRaft.
API Gateway Pattern
The single entry point for microservices. Implementing rate limiting, authentication, and protocol translation/aggregation.
BitTorrent: Pieces, Peer Discovery and Swarm Limits
Understand verified piece exchange, v1 versus v2 metadata, peer discovery, and the capacity limits of cooperative distribution.
Distributed Tracing
How traces connect spans across services to investigate latency, context propagation, and failures.
GraphQL vs REST vs gRPC
Compare REST, GraphQL, and gRPC by API shape, transport, client needs, caching, and operational trade-offs.
OAuth 2.0 & OpenID Connect
Industry-standard protocols for authorization (delegated access) and authentication (identity verification), enabling secure "Sign in with Google/Facebook" and API access without sharing passwords.
Service Discovery
A guide to microservice discovery in dynamic cloud environments, covering client-side vs server-side patterns, health checks, DNS-based discovery, and illustrative integrations using Consul, etcd, Eureka, and Kubernetes services.
Tor Network (Onion Routing)
How onion routing separates network knowledge across relays, how onion services differ from ordinary websites, and what the design does not protect.
WebRTC (Peer-to-Peer Communication)
Browser APIs and protocols for real-time audio, video and data, with signaling, ICE connectivity checks, TURN relay fallback and multiparty media-server tradeoffs.
WebSockets vs Polling
Compare polling, server-sent events, and WebSockets by update pattern, connection behavior, and recovery needs.
Other Concepts
Additional topics.
ACID and BASE: Choose Guarantees per Operation
Distinguish transaction isolation, invariant preservation and replica freshness through a worked inventory example.
Blue-Green Deployment: Traffic Switching and State Compatibility
Plan a two-environment release with capacity headroom, connection draining, compatible schema changes and a testable rollback window.
Cache Eviction Policies
Compare LRU, LFU, ARC, and other cache eviction policies, including their workload assumptions and implementation trade-offs.
CI/CD Pipeline Architecture
Designing robust Continuous Integration and Continuous Deployment pipelines. Strategies for artifact promotion, testing pyramids, canary deployments, and rollback mechanisms.
Concurrency Patterns
Essential patterns for managing concurrent execution. Mutex, Semaphores, Monitors, and modern approaches like the Actor Model and CSP.
Content Delivery Networks: Cache Keys, Freshness and Origin Load
Choose safe cache policies, calculate origin offload, and test personalized responses, invalidation and cold-cache recovery.
Distributed Transactions
How sagas and two-phase commit coordinate changes across services, including recovery, idempotency, and consistency trade-offs.
DNS Architecture
The phonebook of the internet. How Domain Name System works, the DNS hierarchy, and recursive vs iterative resolution strategies.
Docker Internals
How Linux namespaces, cgroups, and layered filesystems provide core container isolation and resource controls.
HTTP Evolution (H1 to H3)
From text-based HTTP/1.1 to binary HTTP/2 and UDP-based HTTP/3 (QUIC). Why we needed upgrades and how they solve Head-of-Line Blocking.
Kubernetes Architecture Explained
Under the hood of K8s: The Control Plane (API Server, Scheduler, Etcd, Controllers) and Data Plane (Kubelet, Kube-proxy, Container Runtime).
MapReduce
A programming model for processing massive datasets in parallel across distributed clusters. Understanding Map, Shuffle, Reduce with real-world use cases from Google, Hadoop, and Spark.
Message Queues
An asynchronous communication mechanism that enables different parts of a system to communicate by sending messages without requiring immediate responses.
Microservices Architecture
An architectural style that structures an application as a collection of loosely coupled, independently deployable services.
ML Model Serving
Taking models from Jupyter Notebooks to Production. Inference patterns (Real-time vs Batch), Batching strategies, and optimization techniques (Quantization, KV Caching).
Object Storage (S3 Design)
How systems like Amazon S3 store petabytes of data. Design internals, Erasure Coding vs Replication, Multipart Uploads, and Consistency Models.
Phi Accrual Failure Detector
An advanced algorithm that uses historical heartbeat data to calculate a suspicion score for an unusually late heartbeat, adapting to network conditions dynamically.
Process vs Thread
Compare processes and threads by address-space isolation, resource sharing, memory behavior, and scheduling.
RAG Architecture (LLMs)
Retrieval-Augmented Generation. How to ground answers in retrieved material, evaluate retrieval, and handle missing or untrusted evidence.
Serverless Architecture (FaaS)
Functions as a Service (AWS Lambda). The Event-Driven paradigm shift. Benefits (Scaling to Zero) vs Drawbacks (Cold Starts, Vendor Lock-in).
TCP Handshake & Congestion
The 3-way handshake that powers the internet. SYN, SYN-ACK, ACK. Flow control vs Congestion control, and modern algorithms like BBR.
The Observability Stack
Moving beyond simple monitoring. How to build a full observability stack using the Three Pillars: Logs, Metrics, and Distributed Tracing.
Write-Ahead Logging (WAL)
The backbone of database durability (ACID). How WAL ensures data isn't lost during crashes, implementation details (LSN, Checkpointing), and its role in replication.