Ecommet
Free course · No sign-up

System design, explained with pictures

Learn how real systems handle millions of users, one idea at a time. 75 topics in 13 modules, from latency and caching to queues and consensus, each with step-by-step diagrams, interview questions and a quick quiz.

  • 75 topics
  • 103 diagrams
  • 12 case studies
  • Quiz on every topic

0% read

  • 0 / 75topics read
  • –average quiz score
  • 0 daysreading streak
  • 0saved to revise

Your progress is saved in this browser. Nothing is sent to us.

  1. Read and watchEach topic explains one idea in plain English. Step through the diagrams to see requests move.
  2. Check yourselfA short quiz at the end of every topic, with an explanation for each answer.
  3. PractiseUse the interview questions and case studies to answer out loud, the way you would in an interview.

Module 01

Foundations

What system design is, how to approach a design interview, and the numbers and vocabulary every later topic builds on.

0 / 5 read

  1. 1.1 Read

    What Is System Design?

    System design is deciding how the parts of a software system fit together so it stays fast, reliable and affordable as it grows. Here is what that means and a step-by-step way to approach any design question.

    Beginner 8 min

  2. 1.2 Read

    Performance vs Scalability

    A performance problem makes a system slow for one user; a scalability problem makes it slow only when many users arrive. Learn the difference, and how scaling up and scaling out fix each.

    Beginner 6 min

  3. 1.3 Read

    Latency vs Throughput

    Latency is how long one request takes; throughput is how many requests finish per second. Learn why percentiles beat averages, how Little's Law links the two, and why tail latency matters at scale.

    Beginner 7 min

  4. 1.4 Read

    Back-of-the-Envelope Estimation

    Quick, rough calculations of requests per second, storage and bandwidth tell you which parts of a design will be under pressure. Learn the handful of numbers and a method you can use in any interview.

    Beginner 5 min

  5. 1.5 Read

    Latency Numbers Every Engineer Should Know

    How long common operations take, from reading memory to sending a packet across the world, and what those gaps mean for design: keep data in memory, avoid round trips, and send less over long distances.

    Beginner 5 min

What happens when data lives on several machines and the network between them fails: the CAP theorem, consistency models, fail-over and how to put a number on availability.

0 / 4 read

  1. 2.1 Read

    CAP Theorem

    When the network splits a distributed database in two, each side must either refuse requests to stay consistent or answer with possibly stale data to stay available. Learn what CAP really says, and how PACELC adds the trade-off you face every day.

    Intermediate 8 min

  2. 2.2 Read

    Consistency Patterns

    Weak, eventual and strong consistency describe when a write becomes visible to readers. Learn each one, the session guarantees users actually notice, and how quorums (R + W > N) give strong reads from replicated data.

    Intermediate 6 min

  3. 2.3 Read

    Availability Patterns: Fail-over and Replication

    How systems stay up when machines fail: active-passive and active-active fail-over, leader-follower and multi-leader replication, and the traps that come with them, such as split brain and lost writes.

    Intermediate 7 min

  4. 2.4 Read

    Availability in Numbers

    What 99.9% and 99.99% availability mean in minutes of downtime, how to calculate the availability of components in series and in parallel, and why every dependency you add lowers the total.

    Beginner 5 min

How a request gets from a phone to a server and back: DNS, TCP and UDP, HTTP and HTTPS, API styles, and keeping connections open for real-time updates.

0 / 6 read

  1. 3.1 Read

    What Happens When You Open a Web Page

    Follow one request from typing a URL to seeing the page: DNS lookup, TCP and TLS handshakes, the load balancer, the app server, the database and back. Every later topic zooms into one of these steps.

    Beginner 6 min

  2. 3.2 Read

    DNS: The Internet’s Phone Book

    How the Domain Name System turns names like example.com into IP addresses, why answers are cached with a TTL, the record types you will meet, and how DNS is used for load balancing and fail-over.

    Beginner 6 min

  3. 3.3 Read

    HTTP and HTTPS

    The protocol behind every web page and API: methods and status codes, safe and idempotent requests, caching headers, how HTTPS keeps traffic private, and what HTTP/2 and HTTP/3 changed.

    Beginner 7 min

  4. 3.4 Read

    TCP vs UDP

    TCP gives you a reliable, ordered stream at the cost of handshakes and waiting for lost packets; UDP sends independent packets with no guarantees and no delay. Learn how each works and when to choose which.

    Beginner 5 min

  5. 3.5 Read

    API Styles: REST, RPC and gRPC, GraphQL

    How services expose their functions: REST around resources, RPC and gRPC around actions with strict contracts, and GraphQL letting clients ask for exactly the fields they need. Plus pagination and versioning that keep APIs usable as they grow.

    Intermediate 6 min

  6. 3.6 Read

    Real-Time: Polling, Long Polling, WebSockets and SSE

    Four ways for a server to tell a client that something happened: polling, long polling, Server-Sent Events and WebSockets. How each works, what it costs, and how to scale millions of open connections.

    Intermediate 8 min

Module 04

Edge and Traffic

Everything between the user and your servers: CDNs, proxies, load balancers and their algorithms, API gateways and rate limiting.

0 / 6 read

  1. 4.1 Read

    Content Delivery Networks (CDNs)

    A CDN keeps copies of your files on servers around the world so users download them from nearby. Learn how pull and push CDNs work, what makes a good cache key, and how to update content safely.

    Beginner 6 min

  2. 4.2 Read

    Forward and Reverse Proxies

    A proxy is a middleman for network traffic. A forward proxy acts for clients; a reverse proxy acts for servers, handling TLS, caching, compression and routing in front of your app.

    Beginner 4 min

  3. 4.3 Read

    Load Balancers

    A load balancer spreads requests across many servers, skips unhealthy ones and lets you add capacity without users noticing. Learn layer 4 vs layer 7, health checks, sticky sessions and how to keep the load balancer itself up.

    Beginner 4 min

  4. 4.4 Read

    Load Balancing Algorithms

    How a load balancer picks a server: round robin, weighted round robin, least connections, hashing and the "power of two choices". When each works, when it fails, and tested code for the main ones.

    Intermediate 6 min

  5. 4.5 Read

    API Gateway

    An API gateway is the single front door to many backend services. It routes requests, checks authentication, applies rate limits and can combine several calls into one. Learn what belongs in it and what does not.

    Intermediate 4 min

  6. 4.6 Read

    Rate Limiting

    Rate limiting caps how many requests a client can make in a period, protecting your system from abuse and overload. Learn token bucket, leaky bucket, fixed and sliding windows, how to share limits across servers, and what to send back.

    Intermediate 7 min

How to split and run the code itself: monoliths and microservices, finding services, making retries safe and keeping servers stateless.

0 / 4 read

  1. 5.1 Read

    Monolith vs Microservices

    A monolith ships the whole application as one unit; microservices split it into small services that deploy on their own. Learn what each costs, when splitting pays off, and how to split along business boundaries.

    Intermediate 7 min

  2. 5.2 Read

    Service Discovery

    Service instances start, stop and move all the time, so callers cannot hard-code addresses. Learn how a service registry, health checks and client-side or server-side discovery let services find each other.

    Intermediate 6 min

  3. 5.3 Read

    Idempotent Operations

    Networks lose responses, so clients retry, and a retried payment must not charge twice. Learn what idempotency means, which HTTP methods have it, and how idempotency keys make any operation safe to retry.

    Intermediate 7 min

  4. 5.4 Read

    Stateless Services and Sessions

    A stateless server keeps nothing about a user between requests, so any server can handle any request. Learn where session data goes instead: a shared store, a database or a signed token.

    Beginner 6 min

Module 06

Databases

Choosing, indexing, replicating and splitting databases: SQL vs NoSQL, transactions, replication, sharding, consistent hashing, tuning and object storage.

0 / 11 read

  1. 6.1 Read

    SQL vs NoSQL: How to Choose

    Relational databases give you tables, joins and transactions; NoSQL databases trade some of that for flexible data models and easy horizontal scaling. Learn the real differences and a simple way to choose.

    Beginner 4 min

  2. 6.2 Read

    Database Indexes

    An index lets the database find rows without reading the whole table, turning seconds into milliseconds. Learn how B-tree and LSM-tree indexes work, composite indexes, and when an index makes things worse.

    Intermediate 6 min

  3. 6.3 Read

    Transactions, ACID and Isolation Levels

    A transaction groups several changes so they all happen or none do. Learn what ACID guarantees, how BASE differs, the anomalies each isolation level allows, and how to avoid lost updates.

    Intermediate 5 min

  4. 6.4 Read

    Database Replication

    Replication keeps copies of your data on several machines for availability and read capacity. Learn leader-follower and multi-leader setups, synchronous vs asynchronous copies, replication lag and failover.

    Intermediate 6 min

  5. 6.5 Read

    Sharding (Partitioning)

    Sharding splits one big dataset across several databases so each holds a slice. Learn range, hash and directory sharding, how to choose a shard key, hot keys, cross-shard queries and resharding.

    Intermediate 6 min

  6. 6.6 Read

    Consistent Hashing

    Consistent hashing places servers and keys on a ring, so adding or removing a server moves only a small share of the keys. Learn how the ring works, why virtual nodes matter, and where it is used.

    Advanced 7 min

  7. 6.7 Read

    Federation (Functional Partitioning)

    Federation splits one database into several by feature: users in one, products in another, orders in a third. Learn what it buys you, what it costs, and how it differs from sharding.

    Beginner 3 min

  8. 6.8 Read

    Denormalization

    Denormalization stores copies or precomputed results so reads skip expensive joins and counts. Learn when it pays off, the common forms (copied columns, counters, materialized views) and how to keep copies in sync.

    Intermediate 4 min

  9. 6.9 Read

    SQL Tuning

    Most slow databases are slow because of a handful of queries. Learn to find them, read query plans, and fix the usual suspects: missing indexes, N+1 queries, SELECT *, deep OFFSET pagination and too many connections.

    Intermediate 5 min

  10. 6.10 Read

    NoSQL Types: Key-Value, Document, Wide-Column, Graph

    NoSQL is not one thing. Key-value, document, wide-column and graph databases each fit different data and queries. Learn how each models data, what it is good at, and where it struggles.

    Beginner 5 min

  11. 6.11 Read

    Blob and Object Storage

    Images, videos, backups and uploads do not belong in your database or on a web server's disk. Learn how object storage works, how clients upload directly with presigned URLs, and how to serve files through a CDN.

    Beginner 5 min

Module 07

Caching

Keeping hot data close: where caches live, how to read and write through them, and how to evict and invalidate without serving wrong data or melting the database.

0 / 3 read

  1. 7.1 Read

    Caching: Where Caches Live

    A cache keeps a copy of data somewhere faster to reach than its source. Learn the layers where caches live, from the browser to the database, what to cache at each, and how to measure whether a cache works.

    Beginner 4 min

  2. 7.2 Read

    Cache Strategies: Cache-Aside, Read-Through, Write-Through, Write-Behind

    How data gets into a cache, and what happens on writes, decides how fresh and how safe your cached data is. Learn cache-aside, read-through, write-through, write-behind and refresh-ahead, with their trade-offs.

    Intermediate 7 min

  3. 7.3 Read

    Cache Eviction, Invalidation and Stampedes

    A cache is small, so something must leave when it fills up, and stale entries must go when data changes. Learn LRU, LFU and TTL eviction, invalidation approaches, and how to stop a cache stampede from flattening your database.

    Intermediate 7 min

Module 08

Asynchronism

Doing work later and elsewhere: message queues and delivery guarantees, background jobs, back pressure, and publish-subscribe with event logs.

0 / 4 read

  1. 8.1 Read

    Message Queues and Delivery Guarantees

    A message queue lets one part of a system hand work to another without waiting for it. Learn how queues decouple services, how acknowledgements and visibility timeouts work, and what at-most-once, at-least-once and exactly-once really mean.

    Intermediate 6 min

  2. 8.2 Read

    Task Queues and Background Jobs

    Slow work such as sending email, resizing images or building reports belongs in background jobs, not in the web request. Learn how task queues and workers run jobs, retry them, schedule them and report results.

    Beginner 5 min

  3. 8.3 Read

    Back Pressure

    When producers send work faster than consumers can handle it, queues grow until something breaks. Back pressure pushes the slowdown back to the source. Learn bounded queues, load shedding and how to tell clients to slow down.

    Intermediate 4 min

  4. 8.4 Read

    Pub/Sub and Event Streaming

    In publish-subscribe, one event reaches every interested subscriber. Event logs such as Kafka keep events on disk so consumers can replay them. Learn topics, partitions, consumer groups, offsets, and when to use a queue or a log.

    Advanced 7 min

The ideas underneath large systems: unique IDs without coordination, leader election and consensus, transactions across services, probabilistic data structures, and clocks you cannot trust.

0 / 5 read

  1. 9.1 Read

    Unique ID Generation

    Auto-increment IDs stop working once data is spread over many databases. Learn the options for globally unique IDs: UUIDs, ticket servers and Snowflake-style IDs that are unique, roughly time-ordered and fit in 64 bits.

    Intermediate 5 min

  2. 9.2 Read

    Leader Election and Consensus

    Many systems need machines to agree on one leader or one order of changes, even when some fail. Learn why that is hard, how majorities (quorums) make it safe, and how Raft elects a leader and replicates a log.

    Advanced 7 min

  3. 9.3 Read

    Distributed Transactions: Two-Phase Commit vs Sagas

    When one business action spans several databases or services, a single local transaction is not enough. Learn how two-phase commit gives atomicity at a cost, and how sagas use local transactions plus compensating actions instead.

    Advanced 6 min

  4. 9.4 Read

    Bloom Filters and Probabilistic Data Structures

    Sometimes an approximate answer from a tiny structure beats an exact answer from a huge one. Learn how Bloom filters test membership, how HyperLogLog counts unique items and how Count-Min Sketch estimates frequencies.

    Advanced 6 min

  5. 9.5 Read

    Clocks and Ordering

    Every machine has its own clock, and they disagree. Learn why wall-clock timestamps cannot order events across machines, and how Lamport clocks, vector clocks and bounded-uncertainty clocks give a reliable order.

    Advanced 5 min

Keeping systems fast and standing when parts fail: common performance antipatterns, timeouts and retries, circuit breakers, bulkheads, health checks, throttling and compensation.

0 / 7 read

  1. 10.1 Read

    Performance Antipatterns

    Most slow systems are slow for the same few reasons. A tour of ten common performance antipatterns, from the busy database and chatty I/O to retry storms and noisy neighbours, with how to spot and fix each one.

    Intermediate 5 min

  2. 10.2 Read

    Timeouts, Retries, Backoff and Jitter

    Every remote call can hang or fail. Learn how to set timeouts, when retrying helps and when it hurts, and why exponential backoff with jitter is the standard way to retry without causing a retry storm.

    Intermediate 5 min

  3. 10.3 Read

    Circuit Breaker

    A circuit breaker stops calling a dependency that keeps failing, so your service fails fast instead of waiting on timeouts, and the dependency gets room to recover. Learn the closed, open and half-open states and how to tune them.

    Intermediate 5 min

  4. 10.4 Read

    Bulkhead

    A ship's bulkheads keep one flooded compartment from sinking the ship. In software, separate pools of threads, connections or servers keep one failing dependency or noisy tenant from taking everything down.

    Intermediate 4 min

  5. 10.5 Read

    Health Checks and Health Endpoints

    Load balancers, orchestrators and monitoring all need to know whether an instance can do its job. Learn liveness vs readiness checks, what a health endpoint should test, and how health checks can cause outages.

    Beginner 3 min

  6. 10.6 Read

    Throttling and Queue-Based Load Leveling

    Traffic is spiky, but capacity is not. Throttling caps how much work each client or the whole system accepts; queue-based load leveling turns bursts into a steady stream. Learn when to use each and how they fit with autoscaling.

    Intermediate 3 min

  7. 10.7 Read

    Compensating Transactions

    When a multi-step operation fails halfway and the finished steps cannot be rolled back, you undo them with new actions: refunds, cancellations, corrections. Learn how to design compensations that are safe to retry and honest about what cannot be undone.

    Advanced 3 min

Knowing what your system is doing: what to monitor, how to instrument with logs, metrics and traces, how to set SLOs, and how to alert people only when it matters.

0 / 3 read

  1. 11.1 Read

    Monitoring: What to Watch

    You cannot fix what you cannot see. Learn what to monitor (health, availability, performance, security and usage), the four golden signals, the RED and USE methods, and why percentiles beat averages.

    Beginner 4 min

  2. 11.2 Read

    Logs, Metrics, Traces and SLOs

    Instrumentation is how a system reports on itself. Learn when to use logs, metrics and traces, how request IDs tie them together, and how SLIs, SLOs, SLAs and error budgets turn "reliable enough" into numbers.

    Intermediate 4 min

  3. 11.3 Read

    Alerting Without Alert Fatigue

    An alert should wake a person only when users are hurt or soon will be, and only when a person can act. Learn symptom-based alerting, burn-rate alerts on SLOs, dashboards that help, runbooks, and how to keep pages rare and meaningful.

    Intermediate 4 min

Named, reusable solutions to recurring problems in distributed systems, grouped by what they help with: messaging, data, design and implementation, reliability and security.

0 / 5 read

  1. 12.1 Read

    Messaging Patterns

    Patterns for services that talk through messages: publisher-subscriber, competing consumers, priority queues, pipes and filters, claim check, sequential convoy, asynchronous request-reply, scheduler agent supervisor and choreography.

    Intermediate 5 min

  2. 12.2 Read

    Data Management Patterns

    Patterns for storing and serving data at scale: CQRS, event sourcing, materialized views, index tables, valet key, static content hosting, sharding and cache-aside, with when each one is worth its complexity.

    Advanced 5 min

  3. 12.3 Read

    Design and Implementation Patterns

    Patterns for structuring services and their edges: strangler fig, sidecar, ambassador, anti-corruption layer, backends for frontends, gateway routing, offloading and aggregation, external configuration, compute resource consolidation and leader election.

    Intermediate 5 min

  4. 12.4 Read

    Reliability Patterns: Availability and Resiliency

    Patterns for staying up when whole servers, zones or regions fail: deployment stamps (cells), geodes, multi-zone and multi-region designs, plus a map of the resiliency patterns covered elsewhere in the course.

    Advanced 4 min

  5. 12.5 Read

    Security Patterns and Authentication Basics

    How systems decide who you are and what you may do: sessions vs tokens, OAuth 2.0 and OpenID Connect at a high level, JWTs, and the federated identity, gatekeeper and valet key patterns.

    Intermediate 5 min

Module 13

Case Studies

Full interview-style designs, each worked through the same steps: requirements, estimates, API, data model, high-level design, deep dives, bottlenecks and wrap-up.

0 / 12 read

  1. 13.1 · Case study Read

    Design a URL Shortener

    Design a service like bit.ly that turns long links into short ones and redirects billions of clicks. A classic first interview question covering ID generation, base62 encoding, caching and read-heavy scaling.

    Beginner 6 min

  2. 13.2 · Case study Read

    Design a Rate Limiter Service

    Design a rate limiter that protects every API in a company: per-client and per-endpoint rules, shared counters across many gateway instances, low added latency, and sensible behaviour when the counter store fails.

    Intermediate 5 min

  3. 13.3 · Case study Read

    Design a Distributed Key-Value Store

    Design a Dynamo-style key-value store: partitioning with consistent hashing, replication, tunable quorums, conflict handling, failure detection and repair. It brings together most of the distributed systems ideas in this course.

    Advanced 5 min

  4. 13.4 · Case study Read

    Design a Unique ID Generator at Scale

    Design a service that hands out unique, roughly time-ordered 64-bit IDs to thousands of servers at millions per second, with no single point of failure. Covers Snowflake layouts, machine ID assignment, clock problems and ID blocks.

    Intermediate 4 min

  5. 13.5 · Case study Read

    Design a News Feed

    Design the home feed of a social app: users follow others and see their posts, newest or most relevant first. The core decision is fan-out on write vs fan-out on read, and how to handle accounts with millions of followers.

    Intermediate 5 min

  6. 13.6 · Case study Read

    Design a Chat App

    Design one-to-one and group messaging like WhatsApp or Slack: persistent connections, message delivery and ordering, storage per conversation, delivery and read receipts, presence, and offline users.

    Intermediate 5 min

  7. 13.7 · Case study Read

    Design a Notification System

    Design a service that sends push, SMS and email notifications for many products: templates, user preferences, per-channel queues and workers, third-party providers, retries, deduplication, rate limits and tracking.

    Intermediate 4 min

  8. 13.8 · Case study Read

    Design a Web Crawler

    Design a crawler that fetches billions of pages for a search engine: the URL frontier, politeness per host, robots.txt, URL normalisation and deduplication, content deduplication, and distributing the work.

    Advanced 5 min

  9. 13.9 · Case study Read

    Design Search Autocomplete

    Design type-ahead suggestions that return the most popular completions for each prefix within tens of milliseconds: tries with precomputed top-k lists, an offline pipeline that aggregates query logs, caching and sharding by prefix.

    Intermediate 5 min

  10. 13.10 · Case study Read

    Design a Video Streaming Platform

    Design a YouTube-style platform: resumable uploads, a transcoding pipeline into many resolutions, segment-based adaptive streaming (HLS/DASH) served from CDNs, and the metadata, views and recommendations around it.

    Advanced 4 min

  11. 13.11 · Case study Read

    Design a Ride-Hailing Service

    Design an Uber-style service: drivers stream locations every few seconds, riders request trips, and the system finds nearby drivers, matches them, and tracks the trip. Covers geospatial indexing, high-frequency writes and matching.

    Advanced 5 min

  12. 13.12 · Case study Read

    Design Distributed File Storage (like a shared drive)

    Design a Dropbox or Google Drive style service: upload, sync and share files across devices. Covers chunking, content hashing and deduplication, metadata vs block storage, sync with change notifications, versions and conflicts.

    Advanced 6 min