Skip to content

About

An open-source, hands-on roadmap to mastering system design. Every concept includes the failure mode, real-world case study, and a runnable lab.

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Latest commit

Β 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ—οΈ System Design in Practice

From Abstract Whiteboard Theory to Resilient Production Systems

An engineering-first, open-source curriculum designed to bridge the chasm between theoretical distributed systems architecture and real-world production engineering. Every concept is analyzed through first principles, failure mechanics, trade-off equations, industry battle-scars, and runnable Docker verification labs.


License: MIT PRs Welcome Labs Curriculum Docker Stars


Interactive Curriculum β€’ Quickstart (60s) β€’ Learning Philosophy β€’ Lab Directory β€’ Contributing Guide


🧭 Quick Jump Matrix

Jump directly to any phase in the curriculum:

Phase Focus Domain Key Invariant / Trade-off Documentation Guides Companion Docker Lab
Phase 1 πŸ“ Foundations & Core Trade-offs Little's Law, PACELC, Serializability 5 Guides 01-latency-vs-throughput
Phase 2 🌐 Networking & Traffic Ingress Anycast, L4 vs L7, Consistent Hashing 6 Guides 02-consistent-hashing
Phase 3 ⚑ Communication Protocols Binary Protobuf vs JSON, QUIC, SSE 5 Guides 03-grpc-vs-rest
Phase 4 πŸ’Ύ Data Layer & Persistence LSM-Trees vs B-Trees, WAL, Sharding 5 Guides 04-replication-lag
Phase 5 πŸš€ Caching Strategies Cache Stampede, XFetch, ARC Eviction 4 Guides 05-cache-stampede
Phase 6 πŸ“¨ Async Messaging & Event Streams Deduplication, DLQ, Outbox Pattern 6 Guides 06-idempotent-consumer
Phase 7 πŸ›‘οΈ Distributed Reliability Circuit Breakers, Bulkheads, Sagas 5 Guides 07-circuit-breaker
Phase 8 πŸ”­ Observability & Monitoring Trace Context, Error Budgets, SLOs 4 Guides 08-distributed-tracing

πŸ’‘ The Pedagogical Philosophy

Most system design resources isolate architecture to abstract boxes on a whiteboard. When systems scale to $100\text{k}+$ QPS, theoretical assumptions collapse: connection pools drain, tail latencies cascade, caches stampede, and replication lags cause silent data corruption.

This repository enforces an immutable 5-Stage Pedagogical Loop across every module:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                                     THE 5-STAGE LEARNING PIPELINE                                      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

    [ 1. CONCEPT ] ─────────► [ 2. CATASTROPHE ] ───────► [ 3. TRADE-OFF ] ────────► [ 4. INDUSTRY CASE ] ─┐
    β€’ First principles        β€’ Real-world outages        β€’ Invariant analysis      β€’ Meta, Netflix, Uber    β”‚
    β€’ Mathematical formulas   β€’ Cascading saturation      β€’ PACELC / CAP bounds     β€’ Stripe, Amazon models  β”‚
    β€’ State boundaries        β€’ Thundering herds          β€’ Latency vs Memory       β€’ Real post-mortems      β”‚
    β€’ Topology diagrams       β€’ Split-brain partitions    β€’ Consistency vs Avail    β€’ Telemetry baselines    β”‚
                                                                                                             β”‚
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    β”‚
    └─► [ 5. RUNNABLE LAB ] ─────────► [ REINFORCED MASTERY ]
        β€’ Docker Compose sandbox      β€’ "I saw the system break under load,
        β€’ Fault injection harness       quantified the inflection point,
        β€’ Synthetic load benchmarks     and verified the mitigation in code."
        β€’ Grafana / Prometheus / Jaeger

Lab Topology Architecture

Each lab runs a production-like distributed microcosm in Docker Compose, fully instrumented with telemetry:

  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”       HTTP / gRPC        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚  Traffic Gen    β”‚ ───────────────────────► β”‚   Ingress / Gateway   β”‚
  β”‚  (k6 / wrk2)    β”‚                          β”‚   (Envoy / NGINX)     β”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
           β”‚                                              β”‚
           β”‚ Synthetic Fault Injection                    β–Ό
           β”‚ (Toxiproxy / Chaos Engine)        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
           └─────────────────────────────────► β”‚  Application Cluster  β”‚
                                               β”‚  (Go / Node / Rust)   β”‚
                                               β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                          β”‚
                                         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                         β–Ό                                 β–Ό
                              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”            β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                              β”‚ State / Storage    β”‚            β”‚ Observability Pod  β”‚
                              β”‚ (Postgres / Redis) β”‚            β”‚ (OTel, Prometheus) β”‚
                              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜            β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

⚑ Quickstart: Running a Lab in 60 Seconds

Experience a production failure mode and verify its mitigation in real time.

1. Prerequisites

Ensure you have the following installed on your machine:

  • Docker Engine v24.0+ & Docker Compose v2.20+
  • GNU Make v4.0+
  • curl and git
docker --version && docker compose version && make --version

2. Launch a Lab (e.g. Cache Stampede Mitigation)

Clone the repository and spin up Lab 05: Cache Stampede:

# 1. Clone the repository
git clone https://github.com/your-username/system-design-roadmap.git
cd system-design-roadmap

# 2. Start the lab environment via Make
make run lab=05-cache-stampede

# (Alternative direct Docker Compose command):
# cd labs/05-cache-stampede && docker compose up -d --build

3. Trigger the Failure & Observe the Fix

# A. Execute the unmitigated cache stampede benchmark (simulating key expiry at 5,000 QPS)
make test-unmitigated lab=05-cache-stampede

# B. Check container logs and database connection pool exhaustion
make logs lab=05-cache-stampede

# C. Apply the distributed mutex / probabilistic early expiration (XFetch) fix
make test-mitigated lab=05-cache-stampede

4. Teardown

# Stop containers and remove lab network
make stop lab=05-cache-stampede

πŸ—ΊοΈ Master Curriculum

Every topic links directly to an exhaustive documentation guide in docs/ and points to its corresponding hands-on lab in labs/.

docs/
β”œβ”€β”€ 01-foundations/             # Latency, throughput, availability, consistency models, CAP/PACELC
β”œβ”€β”€ 02-networking/              # Anycast, L4/L7, reverse proxies, load balancing, consistent hashing, CDNs
β”œβ”€β”€ 03-protocols/               # TCP/UDP, HTTP evolution, REST/GraphQL/gRPC, WebSockets/SSE, polling
β”œβ”€β”€ 04-data-layer/              # RDBMS vs NoSQL, indexes & B-Trees, replication, sharding, WAL
β”œβ”€β”€ 05-caching/                 # Caching tiers, access patterns, eviction policies, stampede mitigation
β”œβ”€β”€ 06-messaging/               # Pub/sub, streaming logs, idempotency, DLQs, backpressure, outbox pattern
β”œβ”€β”€ 07-reliability/             # Rate limiting, circuit breakers, bulkheads, sagas, distributed locks, CQRS
└── 08-observability/           # Metrics/logs/traces, health checks, distributed tracing, alerting & SLOs

Phase 1: Foundations & Core Trade-offs

The mathematical invariants and theoretical principles governing all distributed systems.

Topic Guide Core Invariants & Mathematical Formulations Production Catastrophe Analyzed Companion Lab
Latency vs. Throughput Little’s Law ($L = \lambda W$), Tail At Scale (p99/p99.9), Concurrency Limits Cascading queue starvation during sudden Black Friday traffic bursts lab-01
High Availability & SLAs Availability math (99.9% vs 99.999%), Error budgets, MTTD / MTTR Multi-region cloud storage outages cascading to downstream tiers lab-01
Consistency Models Strict serializability, Linearizability, Sequential, Causal, Eventual Stale balance reads in high-frequency fintech ledger accounts lab-01
CAP & PACELC Theorems Trade-offs during network partitions, PACELC latency penalties Split-brain partition during transient top-of-rack switch flapping lab-01
Back-of-the-Envelope Math Power-of-two approximations, byte math, bandwidth & IOPS sizing Capacity exhaustion leading to emergency scale-out failure lab-01

πŸ§ͺ Companion Lab: labs/01-latency-vs-throughput/ β€” Benchmark how worker pool starvation causes p99 latency explosions while throughput plateaus.


Phase 2: Networking & Traffic Ingress

How packets travel from user devices across global networks to backend application workers.

Topic Guide Core Invariants & Mathematical Formulations Production Catastrophe Analyzed Companion Lab
DNS Resolution & Anycast BGP routing, recursive resolvers, TTL trade-offs, GeoDNS BGP route hijacking and misconfigurations causing global outages lab-02
L4 vs. L7 Load Balancing Packet inspection, TCP termination, TLS offload, kernel bypassing Connection exhaustion on L7 reverse proxies under SYN floods lab-02
Reverse Proxy vs. API Gateway Path routing, auth termination, TLS termination, egress mesh API Gateway memory leaks during token validation thundering herds lab-02
Load Balancing Algorithms Round Robin, Least Connections, IP Hash, Weighted Round Robin Hash hotspots crashing unevenly distributed backend nodes lab-02
Consistent Hashing Hash rings, virtual nodes, bounded loads, churn minimization Mass cache invalidation ($90%$ misses) on cluster node addition lab-02
CDN Architecture (Push vs. Pull) Edge caching, origin shields, cache-control headers, stale-while-revalidate Origin collapse caused by unshielded edge cache mass expirations lab-02

πŸ§ͺ Companion Lab: labs/02-consistent-hashing/ β€” Simulate cache key distribution and migration during node additions/removals with virtual nodes.


Phase 3: Communication Protocols

Serialization performance, transport mechanisms, and network efficiency across microservices.

Topic Guide Core Invariants & Mathematical Formulations Production Catastrophe Analyzed Companion Lab
TCP vs. UDP & QUIC Head-of-line blocking, 3-way handshake, congestion control (BBR) Packet drop storms causing stream stalls in multiplexed HTTP/2 lab-03
HTTP Evolution HTTP/1.1 pipelining, HTTP/2 multiplexing, HTTP/3 UDP transport Head-of-line blocking at the transport layer under packet loss lab-03
REST vs. GraphQL vs. gRPC Protobuf binary encoding, schema enforcement, N+1 query problem Mobile network overhead from bloated JSON payload serialization lab-03
WebSockets vs. SSE Full-duplex persistent connections vs. HTTP unidirectional streams File descriptor exhaustion at 500k concurrent WebSocket clients lab-03
Polling Mechanisms Short polling, long polling (hanging GET), comet architectures Database connection pool collapse under aggressive client polling lab-03

πŸ§ͺ Companion Lab: labs/03-grpc-vs-rest/ β€” Benchmark throughput, CPU consumption, and wire payload sizes comparing Protobuf/gRPC against JSON/REST.


Phase 4: Data Layer & Persistence

Storage engines, disk access patterns, replication topologies, and ACID guarantees.

Topic Guide Core Invariants & Mathematical Formulations Production Catastrophe Analyzed Companion Lab
RDBMS vs. NoSQL Relational integrity, document stores, wide-column, graph models Deep joining across denormalized documents causing OOM crashes lab-04
Database Indexing & B-Trees B+ Trees, LSM-Trees (SSTables/MemTables), write amplification Random disk I/O thrashing due to missing compound indexes lab-04
Replication Strategies Single-leader, multi-leader, quorum replication ($R + W > N$) Asynchronous replication lag causing reading-own-writes anomalies lab-04
Sharding & Partitioning Range vs. Hash sharding, cross-shard joins, re-sharding coordination Celebrity hotkeys causing catastrophic single-shard disk saturation lab-04
Write-Ahead Logging (WAL) Append-only logs, ARIES recovery algorithm, fsync durability Database corruption following unexpected power loss during dirty flush lab-04

πŸ§ͺ Companion Lab: labs/04-replication-lag/ β€” Spin up a MySQL primary-replica cluster, inject heavy write loads, and measure asynchronous read inconsistencies.


Phase 5: Caching Strategies

Reducing database load, minimizing response times, and preventing cache-related outages.

Topic Guide Core Invariants & Mathematical Formulations Production Catastrophe Analyzed Companion Lab
Caching Tiers Client-side, Edge/CDN, Application local, Distributed in-memory Inconsistent cache state across local node memories lab-05
Cache Access Patterns Cache-Aside, Write-Through, Write-Behind, Refresh-Ahead Dual-write race conditions corrupting database state lab-05
Eviction Policies LRU, LFU, FIFO, 2Q, Adaptive Replacement Cache (ARC) High-churn cold data evicting hot working sets lab-05
Stampede & Avalanche Mutex locking, probabilistic early expiration (XFetch), jitter Simultaneous key expiration triggering catastrophic DB meltdown lab-05

πŸ§ͺ Companion Lab: labs/05-cache-stampede/ β€” Recreate a 5,000 QPS cache stampede on Redis and benchmark distributed locking vs. probabilistic early expiration.


Phase 6: Async Messaging & Event Streams

Decoupling services, managing backpressure, and ensuring reliable asynchronous delivery.

Topic Guide Core Invariants & Mathematical Formulations Production Catastrophe Analyzed Companion Lab
Message Queues vs. Pub/Sub Competing consumers, point-to-point queues, topic fan-out Unacknowledged message backlogs driving broker nodes into OOM lab-06
Queues vs. Event Streams Ephemeral queues (RabbitMQ) vs. Append-only logs (Kafka/Redpanda) Head-of-line poison messages blocking consumer partition progress lab-06
Idempotency Idempotency keys, deduplication windows, natural idempotency Duplicate billing chargebacks caused by network retry storms lab-06
Dead Letter Queues (DLQ) Poison pill detection, retry count limits, delayed exponential retry Malformed payloads infinitely retrying and crashing consumers lab-06
Backpressure & Flow Control Pull vs. push models, reactive streams, bounded channel buffers Unbounded in-memory consumer queues crashing under traffic burst lab-06
Transactional Outbox Two-phase commit avoidance, Change Data Capture (Debezium) Dual-write inconsistency where DB committed but message failed lab-06

πŸ§ͺ Companion Lab: labs/06-idempotent-consumer/ β€” Implement a robust Redis-backed deduplication consumer and test duplicate message rejection under chaos.


Phase 7: Distributed Reliability

Preventing localized errors from triggering system-wide cascading failure.

Topic Guide Core Invariants & Mathematical Formulations Production Catastrophe Analyzed Companion Lab
Rate Limiting Algorithms Token Bucket, Leaky Bucket, Fixed Window, Sliding Window Log API abuse causing backend resource exhaustion during scraping spikes lab-07
Circuit Breakers & Retries Closed/Open/Half-Open states, exponential backoff, full jitter Retry storm DDOSing an already struggling downstream service lab-07
Bulkhead Pattern Thread pool isolation, process isolation, resource quotas Unresponsive third-party API consuming all gateway worker threads lab-07
Distributed Locks & Sagas Redlock algorithm, fencing tokens, Saga choreography vs orchestrator Zombie leader writing to database after split-brain timeout lab-07
CQRS & Event Sourcing Command-Query Responsibility Segregation, replayable audit logs Complex projection desynchronization in read models lab-07

πŸ§ͺ Companion Lab: labs/07-circuit-breaker/ β€” Inject high downstream latency with Toxiproxy and watch circuit breakers prevent cascading thread pool starvation.


Phase 8: Observability & Monitoring

Transforming runtime telemetry into actionable operational intelligence and alerting.

Topic Guide Core Invariants & Mathematical Formulations Production Catastrophe Analyzed Companion Lab
Metrics, Logs & Traces Counter/Gauge/Histogram, cardinality costs, structured logging High-cardinality label explosion crashing Prometheus nodes lab-08
Health Checks & Heartbeats Liveness vs. Readiness probes, shallow vs. deep health checks Deep health check hammering downstream DB during service recovery lab-08
Distributed Tracing W3C TraceContext, span propagation, context injection, sampling Blind spots during microservice latency degradation incidents lab-08
Alerting & SLOs SLI/SLO/SLA definitions, multi-window burn rate alerts, error budgets Alert fatigue causing engineers to miss critical customer outages lab-08

πŸ§ͺ Companion Lab: labs/08-distributed-tracing/ β€” Trace cross-service RPC calls across 4 microservices using OpenTelemetry, Envoy, and Jaeger.


πŸ§ͺ Runnable Docker Labs

All labs are isolated, containerized environments situated in labs/. Each lab contains a dedicated docker-compose.yml, load generators, and step-by-step verification commands.

labs/
β”œβ”€β”€ 01-latency-vs-throughput/     # Benchmark queue saturation, concurrency, and p99 cliffs
β”œβ”€β”€ 02-consistent-hashing/        # Visual node balance, ring redistributions, and hotspot simulation
β”œβ”€β”€ 03-grpc-vs-rest/              # Binary Protobuf vs JSON HTTP/1.1 throughput & serialization benchmarks
β”œβ”€β”€ 04-replication-lag/           # Master-replica replication lag monitoring under heavy write stress
β”œβ”€β”€ 05-cache-stampede/            # Thundering herd simulation & distributed mutex/probabilistic caching
β”œβ”€β”€ 06-idempotent-consumer/       # Deduplication strategies under aggressive at-least-once message redeliveries
β”œβ”€β”€ 07-circuit-breaker/           # Cascading failure prevention, thread pool isolation, and fallback logic
└── 08-distributed-tracing/       # Multi-hop trace context propagation with OpenTelemetry and Jaeger

Lab Execution Matrix

Lab Command Target Environment Key Metrics Observed Quick Link
make run lab=01-latency-vs-throughput Go Worker Pool + Hey Benchmark Requests/sec, p50/p95/p99 latency (ms), Queue Depth View Lab
make run lab=02-consistent-hashing Python Node Ring + MurmurHash Key distribution variance, Rehash % upon node addition View Lab
make run lab=03-grpc-vs-rest Rust/Go Dual Service Cluster Payload size (bytes), CPU time per request, Max QPS View Lab
make run lab=04-replication-lag MySQL Primary + 2 Asynchronous Replicas Seconds_Behind_Master, replication stream delay View Lab
make run lab=05-cache-stampede Node.js API + Redis + PostgreSQL DB connection pool exhaustion, CPU spikes, cache hits/sec View Lab
make run lab=06-idempotent-consumer RabbitMQ / Kafka + Redis Deduplicator Duplicate rate, idempotency key TTL accuracy, latency View Lab
make run lab=07-circuit-breaker Envoy + FastAPI + Toxiproxy Fault Injector Trip threshold rate, error response time, recovery time View Lab
make run lab=08-distributed-tracing 4 Polyglot Services + OTel + Jaeger End-to-end trace depth, span durations, context headers View Lab

πŸ“ Topic Anatomy: The 6-Part Standard

To guarantee consistency, rigor, and technical depth across the roadmap, every documentation topic must follow this exact 6-part anatomy:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   THE 6-PART TOPIC SPECIFICATION                       β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ 1. CONCEPTUAL CORE & MENTAL MODEL                                      β”‚
β”‚    β€’ First principles definition                                       β”‚
β”‚    β€’ Visual ASCII topology diagram                                     β”‚
β”‚    β€’ Invariants and mathematical formulation                           β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ 2. THE CATASTROPHE (PRODUCTION FAILURE MODE)                           β”‚
β”‚    β€’ Concrete scenario at 100k+ QPS                                    β”‚
β”‚    β€’ Step-by-step breakdown of how the failure propagates              β”‚
β”‚    β€’ System telemetry during the crash                                 β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ 3. ENGINEERING TRADE-OFFS & CONSTRAINTS                                β”‚
β”‚    β€’ CAP / PACELC theorem positioning                                  β”‚
β”‚    β€’ Space vs. Time & Latency vs. Consistency matrix                   β”‚
β”‚    β€’ When NOT to use this pattern                                      β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ 4. BATTLE-TESTED INDUSTRY ARCHITECTURE                                 β”‚
β”‚    β€’ Real-world implementation (e.g. Meta TAO, Netflix Zuul, Stripe)   β”‚
β”‚    β€’ Architecture diagram of production solution                       β”‚
β”‚    β€’ Specific operational metrics and telemetry signals                β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ 5. ANTI-PATTERNS & COMMON PITFALLS                                     β”‚
β”‚    β€’ Common misconceptions in interviews and designs                   β”‚
β”‚    β€’ Subtle edge cases (clock drift, network splits, zombie leaders)   β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ 6. HANDS-ON VERIFICATION LAB                                           β”‚
β”‚    β€’ Direct pointer to companion Docker lab in labs/                   β”‚
β”‚    β€’ Step-by-step terminal commands to reproduce and fix               β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ› οΈ Makefile Automation Engine

A centralized Makefile automates lab lifecycles, load testing, and container management:

# Display help and available targets
make help

# List all available runnable labs
make list

# Launch a specific lab (builds and starts containers in detached mode)
make run lab=05-cache-stampede

# View real-time aggregated logs of a running lab
make logs lab=05-cache-stampede

# Restart a running lab
make restart lab=05-cache-stampede

# Stop a specific lab environment
make stop lab=05-cache-stampede

# Tear down all running lab containers and prune unused networks
make clean

🀝 Contributing & Extending the Roadmap

We welcome contributions from engineers, architects, and researchers worldwide. Whether refining a mathematical proof, documenting an industry post-mortem, or building a new runnable lab, your contributions make distributed systems engineering accessible to everyone.

How to Contribute in 5 Steps

  1. Fork & Branch:
    git clone https://github.com/your-username/system-design-roadmap.git
    cd system-design-roadmap
    git checkout -b feature/topic-name
  2. Follow the Standard Anatomy: Every new topic in docs/ must strictly implement the 6-Part Standard.
  3. Use ASCII Architecture Topologies: Ensure all architecture flows use crisp ASCII code blocks for effortless rendering across all environments.
  4. Test Your Lab Locally:
    make run lab=<your-lab>
    make logs lab=<your-lab>
    make stop lab=<your-lab>
  5. Open a Pull Request: Submit your PR with a clear summary, benchmark outputs, and references to real-world incidents or academic papers.

For full guidelines, PR templates, and community norms, see CONTRIBUTING.md.


πŸ“„ License

This repository, including all documentation, architecture guides, and lab source code, is open-source software licensed under the MIT License.


Built with engineering discipline by the open-source community.
If this roadmap helps you design and scale more resilient distributed systems, consider starring ⭐️ the repository.

About

An open-source, hands-on roadmap to mastering system design. Every concept includes the failure mode, real-world case study, and a runnable lab.

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages