Skip to content
FollowtheDamnCode

System design

The first category is free. The rest of the fundamentals and every case study are part of Pro.

Networking Fundamentals

How machines actually find and talk to each other before any of your application code runs.

Scaling & Performance

The handful of ideas that show up in almost every system design interview answer.

Storage & Databases

How data is actually kept, replicated, and split up once one machine and one disk aren't enough.

  1. StorageThe real latency hierarchy behind every read and write — memory, SSD, disk, and the network, in order. Pro
  2. Databases and DBMSWhat a database management system actually adds on top of just writing bytes to a file. Pro
  3. SQL DatabasesThe relational model — tables, rows, and a rigid schema you must satisfy before you write. Pro
  4. NoSQL DatabasesKey-value, document, column-family, and graph — four different shapes for when a rigid schema gets in the way. Pro
  5. SQL vs. NoSQL DatabasesSchema-on-write vs. schema-on-read, and the real question that actually decides between them. Pro
  6. Database ReplicationKeeping copies of the same data on multiple machines — for durability, and for spreading out reads. Pro
  7. IndexesA separate, ordered structure that turns a slow full scan into a fast, direct lookup. Pro
  8. Storage Engines: B-Trees vs. LSM TreesHow a database actually lays bytes on disk — update-in-place B-trees, append-and-merge LSM trees, and the write-ahead log under both. Pro
  9. Normalization and DenormalizationSplitting data apart to avoid duplication, and deliberately un-splitting it back for read speed. Pro
  10. ACID and BASETwo opposite promises a database can make about consistency — and which systems actually pick each one. Pro
  11. CAP TheoremDuring a network partition, a distributed system must pick: stay consistent, or stay available. Not both. Pro
  12. PACELC TheoremCAP's extension for the much more common case: no partition at all, just a latency-vs-consistency trade. Pro
  13. Consistency ModelsWhat a read is allowed to return when data is replicated — linearizable, sequential, causal, eventual, and the session guarantees users actually notice. Pro
  14. CRDTs & Vector ClocksTelling "happened before" from "happened at the same time" without trusting clocks, and data types that merge concurrent edits without losing any. Pro
  15. TransactionsBundling several operations into one all-or-nothing unit — a database's actual atomicity guarantee. Pro
  16. Distributed TransactionsMaking 'all or nothing' hold across several separate machines that could each fail independently. Pro
  17. Leader Election and ConsensusHow a group of machines agrees on one leader and one history — even while some of them crash. Pro
  18. ShardingSplitting one dataset across many machines by key, so no single machine has to hold all of it. Pro
  19. Consistent HashingThe hash-ring trick that keeps adding or removing a shard from reshuffling almost everything else. Pro
  20. Geohashing and QuadtreesHow "what's near me?" becomes a fast index lookup instead of a scan of every point. Pro
  21. Database FederationSplitting one database by function into several smaller, independent ones instead of by row. Pro

Data Infrastructure

The specialised building blocks behind IDs, membership tests, search, and the pipelines that move and analyse data at scale.

Architecture Patterns

The macro-level shapes teams choose for how services are built, deployed, and talk to each other.

  1. N-Tier ArchitectureSplitting an app into layered tiers — presentation, application, data — so each can change, scale, or fail on its own. Pro
  2. Message BrokersA middleman process that takes a message from a sender and gets it to the right receiver, without the two ever knowing about each other. Pro
  3. Message QueuesA FIFO buffer between producer and consumer that turns a synchronous call into a durable, retryable, replayable one. Pro
  4. Publish-SubscribeOne event, broadcast to every interested subscriber at once — fire and forget, but everyone who cares still hears it. Pro
  5. Enterprise Service Bus (ESB)One central bus that every service plugs into once, instead of wiring point-to-point integrations between all of them. Pro
  6. Monoliths and MicroservicesOne deployable block that does everything, versus many small services that each do one thing — with very different failure modes. Pro
  7. Event-Driven Architecture (EDA)Services that react to things that already happened instead of being asked to do things, decoupling producers from whoever's listening. Pro
  8. Event SourcingStoring every change that ever happened as an immutable log, instead of overwriting a row with its latest value. Pro
  9. Command and Query Responsibility Segregation (CQRS)Splitting the model that handles writes from the model that handles reads, so each can be shaped for what it's actually good at. Pro
  10. API GatewayOne front door for every backend service, handling routing, auth, and rate limiting so clients don't need your service topology. Pro
  11. API DesignREST, gRPC, and GraphQL — and the unglamorous details that decide whether an API ages well, like pagination, versioning, and errors. Pro
  12. Idempotency and RetriesRetrying safely when you can't tell whether the first attempt worked. Pro
  13. Timeouts, Circuit Breakers & BackpressureStopping one slow dependency from taking down everything that calls it — timeouts, circuit breakers, bulkheads, load shedding, and backpressure. Pro
  14. Service Discovery & ConfigurationHow services find each other when instances come and go every minute — registries, health checks, DNS and sidecars — and how to change configuration without a redeploy. Pro

Reliability & Operations

Keeping a system healthy in production — seeing what it does, shipping changes safely, running it on a fleet, and surviving the loss of a region.

Security & Identity

Proving who is calling, deciding what they may do, and protecting data on the wire and on disk.

Case studies

Worked designs, from requirements to the full architecture.

  1. URL ShortenerThe full reference architecture behind a read-heavy service like bit.ly — caching, short-code generation, and the 301-vs-302 decision. Pro
  2. WhatsAppReal-time messaging at scale — persistent connections, store-and-forward delivery, group fan-out, and media handling. Pro
  3. Twitter / XThe home timeline's fan-out problem — push vs. pull, and the hybrid every real feed actually uses for its celebrity accounts. Pro
  4. NetflixEncoding once, streaming everywhere — adaptive bitrate chunks, CDN edge placement, and why this system is bandwidth-shaped, not database-shaped. Pro
  5. UberReal-time dispatch — geospatial indexing for "who's nearby," two-stage matching, and a constant stream of live location updates. Pro
  6. RAG Search ServiceGrounding an LLM's answers in your own documents — chunking, embeddings, ANN search, and why retrieval and generation fail in different ways. Pro
  7. LLM Agent PlatformThe loop behind an LLM that takes real actions — tool-calling as a validated interface, guardrails on what it's allowed to do, and tracing a chain of model and tool calls. Pro
  8. Rate Limiter ServiceA shared limiter in front of every API — where the counters live, which algorithm, and whether to fail open or closed when the counter store is down. Pro
  9. Distributed Key-Value StoreA Dynamo-style store — partitioning on a hash ring, quorum replication, and the write-ahead log, memtable, and SSTables inside each node. Pro
  10. Web CrawlerFetching a billion pages a month without hammering any one site — the URL frontier, politeness queues, and deduplicating URLs and content at scale. Pro
  11. Search AutocompleteSuggesting the top completions for every keystroke in a few milliseconds — precomputed tries, a batch pipeline for popularity, and caching at every layer. Pro
  12. Notification SystemSending a billion push, email, and SMS messages a day — preferences, per-channel queues, third-party providers, retries, and never notifying anyone twice. Pro
  13. Payment SystemTaking money exactly once — idempotency keys, a double-entry ledger, talking to card networks through a payment processor, and reconciling every night. Pro
  14. Ticket BookingSelling 50,000 seats to two million people in ten minutes — seat holds that expire, atomic claims, a virtual waiting room, and never selling a seat twice. Pro
  15. Proximity SearchFinding coffee near me over 200 million places — geohash cells, why you search nine of them, and an index small enough to keep in memory. Pro
  16. Real-Time LeaderboardRanking 25 million players live — sorted sets, why "what's my rank?" is the hard query, tie-breaking, and what to do when one sorted set isn't enough. Pro
  17. Metrics and Monitoring SystemTen million samples a second — a time-series database built for append-only numbers, compression, downsampling, alert rules, and the cardinality explosion that takes it down. Pro
  18. Distributed Job SchedulerRunning millions of scheduled and delayed jobs on time — partitioned timing wheels, leases instead of locks, at-least-once execution, and idempotent jobs. Pro
  19. Group Chat and PresenceTeam chat with channels of 100,000 members — ordered message logs per channel, fan-out to online members only, read state, and presence that doesn't drown the system. Pro
  20. Video Upload and StreamingA user-video platform end to end — resumable uploads, a parallel transcoding pipeline, a long tail most videos live in, and serving exabytes through CDNs. Pro
  21. File Storage and SyncA cloud drive that keeps every device in step — content-addressed blocks, a metadata journal per folder, delta sync, and what happens when two people edit the same file offline. Pro