Skip to content

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.

Advanced

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.

4 min readRead
Advanced

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.

4 min readRead
Intermediate

Notification Delivery: Queues, Retries and Deadlines

Design a notification service around provider acceptance, recipient delivery, retry ambiguity, queue age and changing preferences.

4 min readRead
Advanced

Payment Workflows: Idempotency, Ledgers and Reconciliation

Trace a payment through an ambiguous timeout, concurrent retries, balanced ledger entries and evidence-based reconciliation.

4 min readRead
Advanced

Ride Matching: Spatial Search and Safe Assignment

Work through stale locations, geographic candidate selection, concurrent driver offers and fenced trip assignments.

4 min readRead
Advanced

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.

4 min readRead
Advanced

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.

4 min readRead
Intermediate

URL Shortener: Allocation, Redirects and Revocation

Design short-link allocation with collision handling, explicit redirect caching, safe revocation and realistic storage estimates.

4 min readRead
Advanced

Video Processing: Resumable Uploads and Atomic Publication

Work through a video pipeline with durable uploads, repeatable encoding tasks, aligned renditions and safe manifest publication.

4 min readRead
Advanced

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.

4 min readRead
Advanced

Web Crawler: Politeness, Scope and Reliable Progress

Build a bounded crawler with per-origin scheduling, robots handling, conservative URL normalization and recoverable fetch state.

4 min readRead

Core Principles

The building blocks of distributed systems.

Intermediate

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.

4 min readRead
Beginner

Caching Overview

Estimate cache benefits and cold-cache risk, choose a cache boundary, and test freshness and failure behavior.

3 min readRead
Intermediate

Caching Strategies

A breakdown of where to place your cache and how to keep it in sync with your database.

3 min readRead
Beginner

CAP Theorem

Reason about a network partition using a reservation example, quorum limits and operation-specific consistency choices.

4 min readRead
Intermediate

Circuit Breaker Pattern

A mechanism to prevent an application from repeatedly trying to execute an operation that's likely to fail.

3 min readRead
Advanced

Consistent Hashing

How to add/remove servers without moving every single key. The ring, virtual nodes, placement and migration tradeoffs.

4 min readRead
Beginner

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.

2 min readRead
Intermediate

Horizontal Scaling (Scaling Out)

The definitive guide to adding more servers to your infrastructure pool and testing the bottlenecks that limit growth.

3 min readRead
Intermediate

Load Balancing

Layer 4 vs Layer 7 Load Balancing. Algorithms (Round Robin, Least Connections, Consistent Hashing). Health checks and real-world implementation with Nginx.

6 min readRead
Beginner

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.

5 min readRead
Intermediate

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.

4 min readRead
Beginner

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.

4 min readRead
Beginner

Vertical Scaling (Scaling Up)

A deep dive into upgrading server hardware to handle increased load, including its limits and best use cases.

3 min readRead

Distributed Algorithms

Data structures and consensus protocols for scale.

Advanced

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.

3 min readRead
Intermediate

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.

6 min readRead
Intermediate

Geohashing (Location Encoding)

A geocoding system that encodes latitude/longitude coordinates into short alphanumeric strings for efficient proximity searches and spatial indexing.

4 min readRead
Advanced

Gossip Protocol

A peer-to-peer communication protocol where information spreads like a virus (or rumor) through the cluster.

3 min readRead
Advanced

HyperLogLog (Cardinality Estimation)

A probabilistic algorithm for counting unique items in massive datasets using minimal memory, with tunable statistical error and compact mergeable state.

5 min readRead
Advanced

Leader Election

Comprehensive guide to distributed leader election algorithms including Raft, Paxos, and Bully algorithm, covering consensus, split-brain prevention, and real-world implementations in Kubernetes, ZooKeeper, and etcd.

4 min readRead
Advanced

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.

3 min readRead
Advanced

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.

3 min readRead
Advanced

Raft Consensus Algorithm

A comprehensive guide to Raft, the consensus algorithm powering Etcd, Consul, and Kubernetes. Leader election, log replication, safety guarantees, and production deployment patterns.

6 min readRead
Intermediate

Token Bucket vs Leaky Bucket

A comprehensive comparison of two fundamental rate limiting algorithms: Token Bucket allows controlled bursts while Leaky Bucket enforces constant output rates.

4 min readRead
Advanced

Top-K Heavy Hitters (Streaming)

How to find 'Trending Topics' in massive real-time streams. MapReduce, Count-Min Sketches, and Sliding Windows.

3 min readRead
Intermediate

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.

4 min readRead

Data & Storage

Databases, replication, and storage engines.

Advanced

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.

3 min readRead
Advanced

Database Indexing

Deep dive into database indexing internals. How B-Trees work, Clustered vs Non-Clustered indexes, Composite Index best practices, and covering indexes.

4 min readRead
Intermediate

Database Replication

The process of copying and maintaining database objects in multiple databases to improve reliability, fault-tolerance, and accessibility.

4 min readRead
Advanced

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.

5 min readRead
Advanced

Distributed File Systems

Complete guide to storing petabytes across thousands of machines using distributed file systems like HDFS and GFS, covering chunking, replication, master-slave architecture, and implementation patterns powering Google, Facebook, and Hadoop ecosystems.

3 min readRead
Beginner

Document Databases

A common type of NoSQL database. Storing data in flexible, JSON-like documents with embedded structures and dynamic schemas.

3 min readRead
Advanced

Event Sourcing & CQRS

Comprehensive guide to Event Sourcing and Command Query Responsibility Segregation (CQRS) patterns, covering immutable event logs, state reconstruction, read/write separation, and real-world implementations in banking, e-commerce, and audit systems.

4 min readRead
Intermediate

Graph Databases

Complete guide to graph databases treating relationships as first-class citizens, covering property graphs, Cypher query language, graph algorithms, and production implementations in Neo4j, Amazon Neptune powering social networks, fraud detection, and recommendation systems.

3 min readRead
Advanced

LSM Trees (Database Internals)

Log-Structured Merge Trees: The data structure powering write-heavy databases like Cassandra and RocksDB.

3 min readRead
Advanced

Redis Internals: Why is it Fast?

Single-threaded Event Loop, RDB vs AOF Persistence, and Pipelining.

2 min readRead
Beginner

SQL vs NoSQL: The Database Guide

Complete database selection guide covering relational vs non-relational systems, ACID vs BASE, when to use PostgreSQL vs MongoDB vs Redis vs Neo4j, and a workload-based selection framework that separates data model, transactions, and scaling.

4 min readRead
Advanced

Vector Databases (AI/Embeddings)

Complete guide to vector databases optimized for AI embeddings and semantic search, covering vector similarity, approximate nearest neighbor algorithms (HNSW, IVF), and production implementations in Pinecone, Milvus, Weaviate, and pgvector powering LLM applications.

3 min readRead

Network & Communication

Protocols, APIs, and messaging.

Advanced

Apache Kafka Architecture

Understanding the internals of the event streaming platform. Topics, Partitions, Offsets, Consumer Groups, and the transition from ZooKeeper to KRaft.

6 min readRead
Beginner

API Gateway Pattern

The single entry point for microservices. Implementing rate limiting, authentication, and protocol translation/aggregation.

5 min readRead
Advanced

BitTorrent: Pieces, Peer Discovery and Swarm Limits

Understand verified piece exchange, v1 versus v2 metadata, peer discovery, and the capacity limits of cooperative distribution.

4 min readRead
Intermediate

Distributed Tracing

Complete guide to tracking requests across microservices using distributed tracing, covering trace context propagation, span instrumentation, OpenTelemetry implementation, and production debugging with Jaeger, Zipkin, and Datadog APM.

3 min readRead
Intermediate

GraphQL vs REST vs gRPC

Comprehensive comparison of three major API paradigms: REST (resource-based), GraphQL (query-based), and gRPC (RPC-based), covering performance, use cases, and implementation trade-offs for modern distributed systems.

5 min readRead
Advanced

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.

5 min readRead
Intermediate

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.

3 min readRead
Advanced

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.

4 min readRead
Advanced

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.

5 min readRead
Intermediate

WebSockets vs Polling

Comprehensive comparison of real-time communication techniques including short polling, long polling, Server-Sent Events (SSE), and WebSockets for building responsive web applications.

5 min readRead

Other Concepts

Additional topics.

Intermediate

ACID and BASE: Choose Guarantees per Operation

Distinguish transaction isolation, invariant preservation and replica freshness through a worked inventory example.

4 min readRead
Intermediate

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.

4 min readRead
Advanced

Cache Eviction Policies

When the cache is full, something has to go. A comprehensive guide to LRU, LFU, ARC, and other replacement algorithms with implementation details.

5 min readRead
Intermediate

CI/CD Pipeline Architecture

Designing robust Continuous Integration and Continuous Deployment pipelines. Strategies for artifact promotion, testing pyramids, canary deployments, and rollback mechanisms.

3 min readRead
Advanced

Concurrency Patterns

Essential patterns for managing concurrent execution. Mutex, Semaphores, Monitors, and modern approaches like the Actor Model and CSP.

3 min readRead
Beginner

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.

5 min readRead
Advanced

Distributed Transactions

Managing data consistency across multiple services where a single operation must either fully succeed or fully fail. Deep dive into SAGA, 2PC, and modern patterns.

5 min readRead
Beginner

DNS Architecture

The phonebook of the internet. How Domain Name System works, the DNS hierarchy, and recursive vs iterative resolution strategies.

4 min readRead
Advanced

Docker Internals

What actually is a container? Just a Linux process with a mask on. Deep dive into Namespaces, Cgroups, and Union Filesystems (OverlayFS).

3 min readRead
Intermediate

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.

3 min readRead
Advanced

Kubernetes Architecture Explained

Under the hood of K8s: The Control Plane (API Server, Scheduler, Etcd, Controllers) and Data Plane (Kubelet, Kube-proxy, Container Runtime).

6 min readRead
Advanced

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.

5 min readRead
Intermediate

Message Queues

An asynchronous communication mechanism that enables different parts of a system to communicate by sending messages without requiring immediate responses.

4 min readRead
Intermediate

Microservices Architecture

An architectural style that structures an application as a collection of loosely coupled, independently deployable services.

4 min readRead
Advanced

ML Model Serving

Taking models from Jupyter Notebooks to Production. Inference patterns (Real-time vs Batch), Batching strategies, and optimization techniques (Quantization, KV Caching).

3 min readRead
Advanced

Object Storage (S3 Design)

How systems like Amazon S3 store petabytes of data. Design internals, Erasure Coding vs Replication, Multipart Uploads, and Consistency Models.

3 min readRead
Advanced

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.

3 min readRead
Intermediate

Process vs Thread

Understanding the fundamental units of execution in operating systems. A deep dive into memory models, context switching costs, and concurrency implementation details.

3 min readRead
Intermediate

RAG Architecture (LLMs)

Retrieval-Augmented Generation. How to ground answers in retrieved material, evaluate retrieval, and handle missing or untrusted evidence.

3 min readRead
Intermediate

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).

3 min readRead
Advanced

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.

3 min readRead
Intermediate

The Observability Stack

Moving beyond simple monitoring. How to build a full observability stack using the Three Pillars: Logs, Metrics, and Distributed Tracing.

3 min readRead
Advanced

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.

4 min readRead