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.

3 min readRead
Intermediate

Horizontal Scaling (Scaling Out)

How adding nodes changes capacity, data distribution, and coordination, with bottleneck estimates and scale-out trade-offs.

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)

How adding resources to one machine affects capacity, cost, hardware limits, and failure exposure.

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

How peers propagate membership and state updates, and how fanout, partitions, expiry and repair affect convergence.

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

How distributed systems choose a coordinator, and how terms, leases, quorums, and fencing help prevent conflicting leaders.

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

Raft consensus explained through leader election, log replication, commitment, safety guarantees, and operational trade-offs.

6 min readRead
Intermediate

Token Bucket vs Leaky Bucket

Compare token bucket and leaky bucket behavior, including burst capacity, refill rate, queueing, and traffic shaping.

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

How B-tree indexes, clustered and secondary layouts, composite keys, and covering indexes affect lookups and write cost.

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

How distributed file systems split files into blocks and manage metadata, replication, locality, and node failures, using HDFS as an example.

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

How event logs support state reconstruction and audit history, and how CQRS separates command handling from query models.

4 min readRead
Intermediate

Graph Databases

How property graphs represent nodes, relationships, and properties, and how traversal queries compare with relational joins.

3 min readRead
Advanced

LSM Trees (Database Internals)

How log-structured merge trees batch writes into sorted files and trade immediate updates for compaction work.

3 min readRead
Advanced

Redis Internals: Why is it Fast?

How Redis's command loop, pipelining, data structures and persistence settings shape latency and recovery tradeoffs.

3 min readRead
Beginner

SQL vs NoSQL: The Database Guide

Compare relational and non-relational data models by query patterns, transaction guarantees, consistency needs, and operational trade-offs.

4 min readRead
Advanced

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.

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

How traces connect spans across services to investigate latency, context propagation, and failures.

3 min readRead
Intermediate

GraphQL vs REST vs gRPC

Compare REST, GraphQL, and gRPC by API shape, transport, client needs, caching, and operational trade-offs.

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

Compare polling, server-sent events, and WebSockets by update pattern, connection behavior, and recovery needs.

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

Compare LRU, LFU, ARC, and other cache eviction policies, including their workload assumptions and implementation trade-offs.

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

How sagas and two-phase commit coordinate changes across services, including recovery, idempotency, and consistency trade-offs.

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

How Linux namespaces, cgroups, and layered filesystems provide core container isolation and resource controls.

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

Compare processes and threads by address-space isolation, resource sharing, memory behavior, and scheduling.

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