System Design

Intermediate · Roadmap · 60 lessons · 12 groups

How a system is actually designed to handle scale: the estimation and tradeoff habits, the networking and API choices, load balancing, caching, data modeling and storage at scale, consistency/availability/consensus, asynchronous messaging, reliability patterns, architecture patterns, and observability and security at scale that a production system needs — closing with worked, end-to-end case studies of the classic system-design interview problems. Sixty lessons that assume the core data structures and algorithms, and general computer science, as a starting point (see datastructures-and-algorithms and computer-science).

0%

Not started

Nothing saved yet. Progress is kept in this browser until you sign in.

Start the path

Design fundamentals & estimation · 4

Networking, APIs & communication · 5

Load balancing & service discovery · 4

Caching at scale · 4

Data modeling & storage · 4

Scaling data & services · 4

Consistency, availability & consensus · 6

Async systems & messaging · 4

Reliability & resilience patterns · 6

Architecture patterns at scale · 5

Observability & security at scale · 6

Case studies · 8

01What Is System Design?System design as a discipline — functional vs. non-functional requirements, and how to work through an open-ended design problem without guessing.Intermediate · 9 min02Performance vs. ScalabilityWhy a fast system isn't automatically a scalable one, and the vertical-ceiling-vs-horizontal-growth framing that explains the difference.Intermediate · 8 min03Latency vs. ThroughputWhy latency and throughput trade off through batching, why averages hide the truth, and how one slow service can dominate a whole request.Intermediate · 6 min04Back-of-the-Envelope EstimationFast, rough math for QPS, storage, and bandwidth using powers-of-two/ten shortcuts — a habit for catching a wrong architecture early.Intermediate · 13 min01DNS and Request Routing at ScaleHow anycast and GeoDNS turn DNS into a coarse load balancer, and the TTL tradeoff between fast failover and cache efficiency.Intermediate · 6 min02Choosing Transport Protocols for ServicesTCP vs UDP for service-to-service calls, how HTTP/1.1 through HTTP/3 changed multiplexing, and why keep-alive matters at scale.Intermediate · 10 min03RPC and gRPCWhat RPC buys you over raw sockets, how gRPC and Protocol Buffers fit together, and when synchronous RPC is the wrong choice.Intermediate · 9 min04API Architectural Styles: REST, GraphQL, and gRPCWhat REST, GraphQL, and gRPC each optimize for, and how to pick between them for a given API.Intermediate · 4 min05Idempotent APIs and Exactly-Once SemanticsWhy retries make idempotency essential, how idempotency keys work, and why "at-least-once plus idempotent" beats chasing true exactly-once.Intermediate · 12 min01Load Balancing AlgorithmsHow round robin, weighted round robin, least connections, consistent hashing, and power-of-two-choices pick which server gets each request.Intermediate · 5 min02Layer 4 vs. Layer 7 Load BalancingWhat a transport-layer load balancer can see and do versus an application-layer one — and the real cost of the difference.Intermediate · 38 min03Reverse Proxies and API GatewaysWhat a reverse proxy adds over a plain load balancer, how it differs from a forward proxy, and what an API gateway layers on top.Intermediate · 13 min04Service DiscoveryHow services find each other at runtime — client-side vs server-side discovery, service registries, and health checks that keep them accurate.Intermediate · 8 min01Caching Layers and CDNsWhere caching sits in a system — browser, CDN, reverse proxy, application, database — and how a CDN serves content from the edge.Intermediate · 6 min02Caching Strategies at ScaleCache-aside, write-through, write-behind, and refresh-ahead — how data actually gets into a cache and stays fresh, and when to use each.Intermediate · 26 min03Distributed Caching SystemsHow Redis/Memcached-style caches spread keys with consistent hashing, and how locking, coalescing, and jitter stop a cache stampede.Intermediate · 8 min04Client and Browser CachingHow Cache-Control, ETags, and service workers let the client itself skip the network entirely — the layer closest to the user.Intermediate · 17 min01SQL vs NoSQL: Choosing How to Model Your DataRelational vs document, key-value, column-family, and graph databases — and the real criteria for picking one over another.Beginner · 10 min02Modeling Data: the Entity-Relationship Model and NormalizationHow to draw entities, attributes, and relationships, then normalize a schema through the first three normal forms — and when to break that rule.Beginner · 41 min03Indexes, Views, and Stored ProceduresHow a database index turns a table scan into a tree lookup, what views and stored procedures are for, and the DDL/DML/DQL/DCL split of SQL itself.Intermediate · 20 min04Choosing a Data Model: Key-Value, Document, Column-Family, and GraphNoSQL isn't one thing — key-value, document, column-family, and graph stores each suit a different access pattern.Intermediate · 4 min01Scaling Data: Replication, Sharding, and FederationThree distinct ways to grow a database past one machine — copying it, splitting it by key, and splitting it by function.Advanced · 9 min02Scaling, Load Balancing, and ClusteringHorizontal vs vertical scaling, how load balancers spread traffic across servers, and what clustering actually buys you.Intermediate · 5 min03Connection Pooling and Read/Write SplittingWhy opening a connection per request doesn't scale, how pooling fixes it, and the staleness tradeoff of routing reads to replicas.Intermediate · 34 min04Stateless Services and Session AffinityStatelessness is what lets a load balancer treat instances as interchangeable; sticky sessions are the fallback when it's missing.Intermediate · 15 min01ACID Transactions, BASE, and the CAP TheoremWhat a database transaction actually guarantees, how BASE relaxes it for scale, and why CAP forces a choice when the network splits.Intermediate · 43 min02Consistency Patterns: Strong, Eventual, and the Space BetweenHow CAP's consistency-vs-availability choice becomes strong, eventual, and causal consistency, plus read-your-writes and session guarantees.Intermediate · 49 min03Availability Patterns and FailoverActive-passive vs active-active topologies, how failover is actually detected and triggered, and the split-brain risk when it goes wrong.Intermediate · 34 min04Measuring Availability: The NinesWhat 99.9% vs 99.99% uptime means in real downtime, how availability multiplies across a dependency chain, and SLA vs SLO.Intermediate · 32 min05Distributed Consensus: Paxos and RaftWhy distributed systems need to agree on one value despite failures, and the core ideas behind Paxos and Raft at a conceptual level.Advanced · 40 min06Distributed Transactions: Two-Phase Commit and SagasWhy two-phase commit blocks when its coordinator fails, and how the saga pattern trades atomicity for availability with compensating transactions.Advanced · 8 min01Message Queues and Asynchronous CommunicationWhy decoupling producers from consumers matters, and how message queues implement point-to-point and publish-subscribe messaging.Intermediate · 13 min02Pub/Sub and Event-Driven ArchitectureHow publish-subscribe differs from point-to-point queues — fan-out to many consumers, event buses, and choreography vs orchestration.Intermediate · 11 min03Backpressure and Flow ControlWhat happens when a producer outpaces a consumer, why bounded queues and load shedding are the real fix, and why a bigger queue usually isn't.Intermediate · 5 min04Change Data Capture for Data PipelinesStreaming a database's write-ahead log to other systems without dual writes — and the transactional outbox pattern that backs it.Advanced · 6 min01Circuit Breakers and RetriesThe circuit breaker state machine, retry with exponential backoff and jitter, and why naive retries turn a blip into a full outage.Intermediate · 53 min02Rate Limiting AlgorithmsToken bucket, leaky bucket, fixed-window, and sliding-window rate limiters — how each one actually behaves at a burst boundary.Intermediate · 20 min03Bulkheads and Graceful DegradationIsolating resource pools so one failing dependency can't exhaust everything, plus feature flags and fallbacks for degrading gracefully under partial failure.Intermediate · 8 min04Health Checks and Chaos EngineeringLiveness vs readiness checks that feed load balancers and orchestrators, and chaos engineering as deliberately testing whether resilience assumptions hold.Intermediate · 43 min05Performance AntipatternsRecognizable failure patterns — busy database, chatty I/O, sync-where-async-would-do, noisy neighbor, extraneous fetching — and how to fix each.Intermediate · 40 min06Leader ElectionPractical leader-election mechanisms — the bully algorithm and lease-based election via etcd/ZooKeeper-style ephemeral nodes and TTLs.Intermediate · 9 min01Monolith vs. Microservices: The Real Trade-offsWhat splitting a monolith into microservices actually buys and costs you, and the concrete signals that tell you a system is ready to split.Intermediate · 5 min02CQRS and Event SourcingWhy separating reads from writes (CQRS) and treating an event log as the source of truth (event sourcing) are a natural pairing — and their real costs.Advanced · 15 min03Strangler Fig and Anti-Corruption LayerMigrating a legacy monolith incrementally by routing growing slices of traffic to new services, and shielding new code from the old system's data model.Intermediate · 24 min04Sidecar, Ambassador, and Service MeshAttaching networking, observability, and security to a service without touching its code — from one sidecar to a mesh across an entire fleet.Advanced · 16 min05Backend for Frontend and Gateway PatternsWhy one API gateway serving every client type becomes a bottleneck, and how a tailored backend per client (BFF) fixes it.Intermediate · 9 min01Monitoring, Logging, and AlertingMetrics, logs, and traces as observability's pillars, why structured logging matters, and what makes an alert actionable instead of noise.Intermediate · 18 min02Distributed TracingWhy one request spanning a dozen services needs a trace ID and per-hop spans, and how a trace waterfall reveals which hop is slow.Intermediate · 17 min03SLIs, SLOs, and Error BudgetsHow SLIs, SLOs, and SLAs turn "how reliable should this be" into a number, and how an error budget governs release velocity.Intermediate · 31 min04DDoS Mitigation and Rate Limiting for SecurityDefending against DDoS and abusive bot traffic with scrubbing, edge shielding, IP reputation, and challenge pages beyond ordinary rate limiting.Advanced · 22 min05Authentication and Federated Identity at ScaleHow a distributed system centralizes authentication with an identity provider and tokens instead of every service checking passwords itself.Intermediate · 21 min06Secrets and Config ManagementWhy secrets and per-environment config don't belong in code or images, and how centralized secrets stores and rotation reduce real risk.Intermediate · 17 min01Case Study: Design a URL ShortenerA worked design for a bit.ly-style shortener, covering short-code generation, collision handling, and the cache that keeps redirects fast.Advanced · 25 min02Case Study: Design a Rate LimiterA worked design for a shared, distributed rate limiter that stays low-latency and avoids becoming the bottleneck it was built to prevent.Advanced · 56 min03Case Study: Design a Key-Value StoreA worked, Dynamo-style design for a distributed key-value store, covering partitioning, the replication/consistency tradeoff, and conflict resolution.Advanced · 36 min04Case Study: Design a Distributed CacheA worked design for a Redis/Memcached-style distributed cache, covering eviction, cross-node invalidation, and resizing without a full reshuffle.Advanced · 34 min05Case Study: Design a Chat SystemA worked design for a WhatsApp/Messenger-style chat system, covering real-time delivery, message ordering, and presence at scale.Advanced · 25 min06Case Study: Design a News Feed / Notification SystemA worked design for a social feed and notification pipeline, centered on the fan-out-on-write vs. fan-out-on-read decision.Advanced · 44 min07Case Study: Design a Web CrawlerA worked design for a large-scale web crawler, covering the URL frontier, dedup, per-domain politeness, and the graph's unbounded size.Advanced · 46 min08Case Study: Design a Search AutocompleteA worked design for a type-ahead search suggestion system, covering the trie structure, how suggestions stay fresh, and latency budget.Advanced · 20 min

Design fundamentals & estimation

4 lessons

  1. 01 / 04What Is System Design?System design as a discipline — functional vs. non-functional requirements, and how to work through an open-ended design problem without guessing.9 min
  2. 02 / 04Performance vs. ScalabilityWhy a fast system isn't automatically a scalable one, and the vertical-ceiling-vs-horizontal-growth framing that explains the difference.8 min
  3. 03 / 04Latency vs. ThroughputWhy latency and throughput trade off through batching, why averages hide the truth, and how one slow service can dominate a whole request.6 min
  4. 04 / 04Back-of-the-Envelope EstimationFast, rough math for QPS, storage, and bandwidth using powers-of-two/ten shortcuts — a habit for catching a wrong architecture early.13 min

Networking, APIs & communication

5 lessons

  1. 01 / 05DNS and Request Routing at ScaleHow anycast and GeoDNS turn DNS into a coarse load balancer, and the TTL tradeoff between fast failover and cache efficiency.6 min
  2. 02 / 05Choosing Transport Protocols for ServicesTCP vs UDP for service-to-service calls, how HTTP/1.1 through HTTP/3 changed multiplexing, and why keep-alive matters at scale.10 min
  3. 03 / 05RPC and gRPCWhat RPC buys you over raw sockets, how gRPC and Protocol Buffers fit together, and when synchronous RPC is the wrong choice.9 min
  4. 04 / 05API Architectural Styles: REST, GraphQL, and gRPCWhat REST, GraphQL, and gRPC each optimize for, and how to pick between them for a given API.4 min
  5. 05 / 05Idempotent APIs and Exactly-Once SemanticsWhy retries make idempotency essential, how idempotency keys work, and why "at-least-once plus idempotent" beats chasing true exactly-once.12 min

Load balancing & service discovery

4 lessons

  1. 01 / 04Load Balancing AlgorithmsHow round robin, weighted round robin, least connections, consistent hashing, and power-of-two-choices pick which server gets each request.5 min
  2. 02 / 04Layer 4 vs. Layer 7 Load BalancingWhat a transport-layer load balancer can see and do versus an application-layer one — and the real cost of the difference.38 min
  3. 03 / 04Reverse Proxies and API GatewaysWhat a reverse proxy adds over a plain load balancer, how it differs from a forward proxy, and what an API gateway layers on top.13 min
  4. 04 / 04Service DiscoveryHow services find each other at runtime — client-side vs server-side discovery, service registries, and health checks that keep them accurate.8 min

Caching at scale

4 lessons

  1. 01 / 04Caching Layers and CDNsWhere caching sits in a system — browser, CDN, reverse proxy, application, database — and how a CDN serves content from the edge.6 min
  2. 02 / 04Caching Strategies at ScaleCache-aside, write-through, write-behind, and refresh-ahead — how data actually gets into a cache and stays fresh, and when to use each.26 min
  3. 03 / 04Distributed Caching SystemsHow Redis/Memcached-style caches spread keys with consistent hashing, and how locking, coalescing, and jitter stop a cache stampede.8 min
  4. 04 / 04Client and Browser CachingHow Cache-Control, ETags, and service workers let the client itself skip the network entirely — the layer closest to the user.17 min

Data modeling & storage

4 lessons

  1. 01 / 04SQL vs NoSQL: Choosing How to Model Your DataRelational vs document, key-value, column-family, and graph databases — and the real criteria for picking one over another.10 min
  2. 02 / 04Modeling Data: the Entity-Relationship Model and NormalizationHow to draw entities, attributes, and relationships, then normalize a schema through the first three normal forms — and when to break that rule.41 min
  3. 03 / 04Indexes, Views, and Stored ProceduresHow a database index turns a table scan into a tree lookup, what views and stored procedures are for, and the DDL/DML/DQL/DCL split of SQL itself.20 min
  4. 04 / 04Choosing a Data Model: Key-Value, Document, Column-Family, and GraphNoSQL isn't one thing — key-value, document, column-family, and graph stores each suit a different access pattern.4 min

Scaling data & services

4 lessons

  1. 01 / 04Scaling Data: Replication, Sharding, and FederationThree distinct ways to grow a database past one machine — copying it, splitting it by key, and splitting it by function.9 min
  2. 02 / 04Scaling, Load Balancing, and ClusteringHorizontal vs vertical scaling, how load balancers spread traffic across servers, and what clustering actually buys you.5 min
  3. 03 / 04Connection Pooling and Read/Write SplittingWhy opening a connection per request doesn't scale, how pooling fixes it, and the staleness tradeoff of routing reads to replicas.34 min
  4. 04 / 04Stateless Services and Session AffinityStatelessness is what lets a load balancer treat instances as interchangeable; sticky sessions are the fallback when it's missing.15 min

Consistency, availability & consensus

6 lessons

  1. 01 / 06ACID Transactions, BASE, and the CAP TheoremWhat a database transaction actually guarantees, how BASE relaxes it for scale, and why CAP forces a choice when the network splits.43 min
  2. 02 / 06Consistency Patterns: Strong, Eventual, and the Space BetweenHow CAP's consistency-vs-availability choice becomes strong, eventual, and causal consistency, plus read-your-writes and session guarantees.49 min
  3. 03 / 06Availability Patterns and FailoverActive-passive vs active-active topologies, how failover is actually detected and triggered, and the split-brain risk when it goes wrong.34 min
  4. 04 / 06Measuring Availability: The NinesWhat 99.9% vs 99.99% uptime means in real downtime, how availability multiplies across a dependency chain, and SLA vs SLO.32 min
  5. 05 / 06Distributed Consensus: Paxos and RaftWhy distributed systems need to agree on one value despite failures, and the core ideas behind Paxos and Raft at a conceptual level.40 min
  6. 06 / 06Distributed Transactions: Two-Phase Commit and SagasWhy two-phase commit blocks when its coordinator fails, and how the saga pattern trades atomicity for availability with compensating transactions.8 min

Async systems & messaging

4 lessons

  1. 01 / 04Message Queues and Asynchronous CommunicationWhy decoupling producers from consumers matters, and how message queues implement point-to-point and publish-subscribe messaging.13 min
  2. 02 / 04Pub/Sub and Event-Driven ArchitectureHow publish-subscribe differs from point-to-point queues — fan-out to many consumers, event buses, and choreography vs orchestration.11 min
  3. 03 / 04Backpressure and Flow ControlWhat happens when a producer outpaces a consumer, why bounded queues and load shedding are the real fix, and why a bigger queue usually isn't.5 min
  4. 04 / 04Change Data Capture for Data PipelinesStreaming a database's write-ahead log to other systems without dual writes — and the transactional outbox pattern that backs it.6 min

Reliability & resilience patterns

6 lessons

  1. 01 / 06Circuit Breakers and RetriesThe circuit breaker state machine, retry with exponential backoff and jitter, and why naive retries turn a blip into a full outage.53 min
  2. 02 / 06Rate Limiting AlgorithmsToken bucket, leaky bucket, fixed-window, and sliding-window rate limiters — how each one actually behaves at a burst boundary.20 min
  3. 03 / 06Bulkheads and Graceful DegradationIsolating resource pools so one failing dependency can't exhaust everything, plus feature flags and fallbacks for degrading gracefully under partial failure.8 min
  4. 04 / 06Health Checks and Chaos EngineeringLiveness vs readiness checks that feed load balancers and orchestrators, and chaos engineering as deliberately testing whether resilience assumptions hold.43 min
  5. 05 / 06Performance AntipatternsRecognizable failure patterns — busy database, chatty I/O, sync-where-async-would-do, noisy neighbor, extraneous fetching — and how to fix each.40 min
  6. 06 / 06Leader ElectionPractical leader-election mechanisms — the bully algorithm and lease-based election via etcd/ZooKeeper-style ephemeral nodes and TTLs.9 min

Architecture patterns at scale

5 lessons

  1. 01 / 05Monolith vs. Microservices: The Real Trade-offsWhat splitting a monolith into microservices actually buys and costs you, and the concrete signals that tell you a system is ready to split.5 min
  2. 02 / 05CQRS and Event SourcingWhy separating reads from writes (CQRS) and treating an event log as the source of truth (event sourcing) are a natural pairing — and their real costs.15 min
  3. 03 / 05Strangler Fig and Anti-Corruption LayerMigrating a legacy monolith incrementally by routing growing slices of traffic to new services, and shielding new code from the old system's data model.24 min
  4. 04 / 05Sidecar, Ambassador, and Service MeshAttaching networking, observability, and security to a service without touching its code — from one sidecar to a mesh across an entire fleet.16 min
  5. 05 / 05Backend for Frontend and Gateway PatternsWhy one API gateway serving every client type becomes a bottleneck, and how a tailored backend per client (BFF) fixes it.9 min

Observability & security at scale

6 lessons

  1. 01 / 06Monitoring, Logging, and AlertingMetrics, logs, and traces as observability's pillars, why structured logging matters, and what makes an alert actionable instead of noise.18 min
  2. 02 / 06Distributed TracingWhy one request spanning a dozen services needs a trace ID and per-hop spans, and how a trace waterfall reveals which hop is slow.17 min
  3. 03 / 06SLIs, SLOs, and Error BudgetsHow SLIs, SLOs, and SLAs turn "how reliable should this be" into a number, and how an error budget governs release velocity.31 min
  4. 04 / 06DDoS Mitigation and Rate Limiting for SecurityDefending against DDoS and abusive bot traffic with scrubbing, edge shielding, IP reputation, and challenge pages beyond ordinary rate limiting.22 min
  5. 05 / 06Authentication and Federated Identity at ScaleHow a distributed system centralizes authentication with an identity provider and tokens instead of every service checking passwords itself.21 min
  6. 06 / 06Secrets and Config ManagementWhy secrets and per-environment config don't belong in code or images, and how centralized secrets stores and rotation reduce real risk.17 min

Case studies

8 lessons

  1. 01 / 08Case Study: Design a URL ShortenerA worked design for a bit.ly-style shortener, covering short-code generation, collision handling, and the cache that keeps redirects fast.25 min
  2. 02 / 08Case Study: Design a Rate LimiterA worked design for a shared, distributed rate limiter that stays low-latency and avoids becoming the bottleneck it was built to prevent.56 min
  3. 03 / 08Case Study: Design a Key-Value StoreA worked, Dynamo-style design for a distributed key-value store, covering partitioning, the replication/consistency tradeoff, and conflict resolution.36 min
  4. 04 / 08Case Study: Design a Distributed CacheA worked design for a Redis/Memcached-style distributed cache, covering eviction, cross-node invalidation, and resizing without a full reshuffle.34 min
  5. 05 / 08Case Study: Design a Chat SystemA worked design for a WhatsApp/Messenger-style chat system, covering real-time delivery, message ordering, and presence at scale.25 min
  6. 06 / 08Case Study: Design a News Feed / Notification SystemA worked design for a social feed and notification pipeline, centered on the fan-out-on-write vs. fan-out-on-read decision.44 min
  7. 07 / 08Case Study: Design a Web CrawlerA worked design for a large-scale web crawler, covering the URL frontier, dedup, per-domain politeness, and the graph's unbounded size.46 min
  8. 08 / 08Case Study: Design a Search AutocompleteA worked design for a type-ahead search suggestion system, covering the trie structure, how suggestions stay fresh, and latency budget.20 min
Esc
↑↓ navigate↵ open? shortcuts

Keyboard shortcuts

Press Esc to close

Anywhere

⌘K
Search and commands
/
Search
?
This sheet
Esc
Close

Reading a lesson

J
Next lesson
K
Previous lesson
B
Bookmark