Distributed Systems
Consistency, consensus, replication and coordination — the CAP-theorem-shaped trade-offs at the heart of every large-scale system, with handbooks, system designs and interactive tools.
Handbooks 4
The System Design Fundamentals Handbook
The load-bearing ideas behind every distributed system — the CAP theorem and consistency models, concurrency and locking, partitioning and replication, and consensus and coordination — each tied to a real worked design you can study interactively.
CAP Theorem & Consistency Models
What a distributed system can promise when the network splits — CP vs AP, why "CA" is a myth, PACELC, and the full spectrum from linearizable to eventual consistency. Part of System Design Fundamentals.
Partitioning, Sharding & Replication
How one dataset becomes many — range vs hash partitioning, consistent hashing and virtual nodes, hot partitions, replication topologies, replication lag, and quorums. Part of System Design Fundamentals.
Consensus, Transactions & Coordination
How nodes that can crash still agree on one truth — majority quorums, Raft and Paxos, leader election, two-phase commit vs the saga pattern, and idempotency for exactly-once effects. Part of System Design Fundamentals.
System Designs 14
Design Uber
Build a planet-scale ride-hailing system step by step. Learn how to handle real-time location tracking, matching algorithms, scalability, and payments through an interactive diagram that grows with each concept.
Design a URL Shortener
Build a URL shortener (think Bitly or TinyURL) step by step. Learn how to mint unique short codes with base62, make the read-heavy redirect path sub-millisecond with caching, shard billions of mappings, and track clicks asynchronously through an interactive diagram that grows with each concept.
Design a Rate Limiter
Build a distributed rate limiter step by step. Learn where to put the check, how to key and tier limits, the token-bucket and sliding-window algorithms, why shared atomic counters in Redis avoid race conditions, and the fail-open vs fail-closed trade-off — through an interactive diagram that grows with each concept.
Design Ticketmaster
Build an event-booking system step by step. Tackle the double-booking problem head-on: seat inventory, short-lived holds with TTLs, exactly-once purchases via ACID transactions, payment sagas with idempotency, and a virtual waiting room that tames the on-sale stampede — through an interactive diagram that grows with each concept.
Design a Message Queue
Build a distributed message queue like Kafka step by step. See how an append-only commit log, partitions keyed for order, consumer groups with server-side offsets, leader/follower replication, controller-driven leader election, retention and compaction, and exactly-once guarantees fit together — through an interactive diagram that grows with each concept.
Design a Key-Value Store
Build a distributed key-value store like DynamoDB step by step. See how consistent hashing places keys, how replication and tunable quorums (R + W > N) trade consistency for availability, how vector clocks resolve conflicts, and how gossip membership, hinted handoff and read repair keep it alive through failure — through an interactive diagram that grows with each concept.
Design a Distributed Cache
Build a distributed cache like Redis or Memcached step by step. See how cache-aside shields the database, how consistent hashing shards across nodes, how TTL and LRU/LFU eviction bound memory, how replication and invalidation keep it correct, and how to survive cache stampedes and hot keys — through an interactive diagram that grows with each concept.
Design a Web Crawler
Build a distributed web crawler step by step. See how a URL frontier drives the fetch–parse–enqueue loop, how a bloom-filter seen-set stops infinite re-crawling, how politeness and robots.txt keep you a good citizen, how DNS caching and content dedup remove bottlenecks, and how to shard the frontier by host and dodge traps — through an interactive diagram that grows with each concept.
Design Google Docs
Build a real-time collaborative editor step by step. See how edits become tiny operations, how OT and CRDTs resolve concurrent edits so every copy converges, how ops broadcast over WebSockets, how an op log plus snapshots give history and recovery, and how presence, offline sync and per-document sharding fit together — through an interactive diagram that grows with each concept.
Design a Job Scheduler
Build a distributed job scheduler (cron at scale) step by step. See how a durable job store indexed by run time, a due scanner, a ready queue feeding a worker pool, idempotent at-least-once execution, leader election to avoid double-fires, retries with backoff and a DLQ, and time-wheel sharding fit together — through an interactive diagram that grows with each concept.
Design an ID Generator
Build a distributed unique ID generator like Twitter Snowflake step by step. See why auto-increment and UUIDs fall short, how a 64-bit ID packs a timestamp, machine id and sequence to stay collision-free and time-sortable without per-ID coordination, how machine ids are assigned, and how clock skew is handled — through an interactive diagram that grows with each concept.
Design Airbnb
Build a lodging marketplace step by step. See how listings and geo search with filters, per-listing availability calendars, atomic booking that never double-books, payment hold-and-capture with idempotency, event-driven reviews and reindexing, and read replicas fit together — through an interactive diagram that grows with each concept.
Design a Stock Exchange
Build a stock exchange matching engine step by step. See how an in-memory order book with price-time priority matches orders, how pre-trade risk checks guard the core, how a single sequencer and single-threaded engine give deterministic low-latency matching, and how market-data feeds, journaling/replay, clearing and symbol partitioning fit together — through an interactive diagram that grows with each concept.
Design a Payment System
Build a payment system like Stripe step by step. See how a payment is modeled as a state machine of authorize and capture, how idempotency keys prevent double-charges, how a double-entry ledger keeps every cent auditable, how tokenization shrinks PCI scope, and how async webhooks, reconciliation and a durable retryable worker handle slow banks and failure — through an interactive diagram that grows with each concept.
Interactive Tools 3
Consistent Hashing Visualizer
An interactive consistent-hashing playground. Add and remove nodes, tune virtual nodes, and watch keys remap around the ring in real time — see exactly why consistent hashing moves only K/N keys instead of reshuffling everything, and how virtual nodes smooth out hotspots.
Quorum (N/R/W) Explorer
Dial the replica count and the read/write quorum sizes and see at a glance whether reads are guaranteed strongly consistent (R + W > N), how many node failures you can survive, and where you land on the latency–availability spectrum. The tunable-consistency intuition, made tactile.
Availability (Nines) Calculator
Chain dependencies in series and parallel and watch the combined availability — and the yearly downtime it implies — fall out. Unlike single-service "nines" calculators, this one models the dependency graph, so you see how one shaky component drags down the whole system.