# System Design Step by Step: A Free Course in 7 Modules

> A free system design course in seven modules: scaling, caching, databases, consistency, reliability and case studies, with step-through animated diagrams.

URL: https://www.matthewswong.com/en/learn/system-design/

Reviewed on 13 October 2026 · By Matthews Wong (https://www.matthewswong.com/en/about/)

> System design is the practice of turning requirements into an architecture that holds up under load and failure. This free course teaches it in seven core lessons, one per module, from capacity estimation and caching to replication, consistency, reliability patterns and a full case study, then four deep dives on API design, real-time delivery, idempotency and event-driven systems. Each lesson has a diagram you step through and a short quiz, then 51 posts to go further.

Free, no sign-up, no certificate. Built from the setup that runs this website.

## What you will be able to do

- Estimate load and storage from a requirement, and size a design to it.
- Choose between caching, replication, partitioning and sharding for a real bottleneck.
- Explain consistency, consensus and reliability trade-offs in plain words.
- Work through a system design interview with one repeatable framework.

## Who it is for

Developers preparing for system design interviews, and engineers who want the reasoning behind the architectures they already run.

## Before you start

- You have built a web app with a database.
- Read the modules in order the first time; jump around afterwards.

## Lessons

1. [System Design Estimation for Beginners: Users to Servers](https://www.matthewswong.com/en/learn/system-design/system-design-estimation-for-beginners/): System design estimation step by step: turn daily users into peak requests per second, storage and servers, then link latency to load with Little's law.
2. [How to Scale a Web Application: Stateless Servers to CDN](https://www.matthewswong.com/en/learn/system-design/how-to-scale-a-web-application/): How to scale a web application step by step: stateless copies behind a load balancer, sessions in a shared store, then a CDN and a cache to absorb reads.
3. [How to Scale a Database: Indexes, Replicas and Sharding](https://www.matthewswong.com/en/learn/system-design/how-to-scale-a-database/): How to scale a database step by step: model data around queries, add the right index, use read replicas despite lag, then shard by key with IDs that scale.
4. [Consistency in Distributed Systems Explained: ACID, CAP, Sagas](https://www.matthewswong.com/en/learn/system-design/consistency-in-distributed-systems/): Consistency in distributed systems, step by step: ACID and isolation on one node, CAP and PACELC, two-phase commit versus sagas, and leases with fencing.
5. [Reliability Patterns Explained: Retries to Circuit Breakers](https://www.matthewswong.com/en/learn/system-design/reliability-patterns-explained/): Reliability patterns explained: SLOs, error budgets, redundancy, failover, retries with backoff and jitter, bulkheads, backpressure, circuit breakers.
6. [Microservices for Beginners: Boundaries, Sync vs Async, Queues](https://www.matthewswong.com/en/learn/system-design/microservices-for-beginners/): Learn microservices from the ground up: when a modular monolith is enough, how to draw service boundaries, and when a call should be sync, async or queued.
7. [System Design Case Study Example: Designing This Website](https://www.matthewswong.com/en/learn/system-design/system-design-case-study-example/): A worked system design case study: the seven-step framework applied to this website, from requirements and numbers to the request path and its weak spots.
8. [API Design for Beginners: Resources, Errors and Versioning](https://www.matthewswong.com/en/learn/system-design/api-design-for-beginners/): API design for beginners: resources and methods, honest status codes, one error shape, versioning and deprecation, rate limits, pagination and OpenAPI.
9. [WebSocket vs SSE vs Long Polling: Real-Time Updates Explained](https://www.matthewswong.com/en/learn/system-design/websocket-vs-sse-vs-long-polling/): WebSocket vs SSE vs long polling: how each one delivers server updates, what it keeps open, Last-Event-ID reconnects, proxy buffering and idle timeouts.
10. [Idempotency Explained: Safe Retries and Idempotency Keys](https://www.matthewswong.com/en/learn/system-design/idempotency-explained/): Idempotency explained: safe vs idempotent HTTP methods, why retries need it, how idempotency keys work, idempotent consumers, upserts and re-runnable jobs.
11. [Event-Driven Architecture Explained: Queues, Logs and Outbox](https://www.matthewswong.com/en/learn/system-design/event-driven-architecture-explained/): Event-driven architecture explained: events vs commands, queues vs logs, at-least-once delivery, idempotent consumers, ordering, backlog and the outbox.

## Module 1: Foundations: think in requirements and numbers

Every later choice in the course is a trade-off measured in latency, throughput or load. If you cannot turn ten million users into requests per second, you cannot judge whether a cache or a shard is needed. This module gives you the vocabulary and the arithmetic, then moves straight on to components.

- [System Design for Developers: What It Is and How to Learn It](https://www.matthewswong.com/en/blog/system-design-explained-for-developers/)
- [Latency vs Throughput: Differences, Trade-offs and Tuning](https://www.matthewswong.com/en/blog/latency-vs-throughput-explained/)
- [Back-of-the-Envelope Capacity Estimation: QPS to Servers](https://www.matthewswong.com/en/blog/back-of-the-envelope-capacity-estimation/)

## Module 2: Scaling the stateless tier and the read path

Once your estimate says one server is not enough, the cheapest place to scale is the tier that holds no state: run more copies, spread requests across them, and stop repeating reads you have already answered. Consistent hashing closes the module because deciding which node owns a key is exactly the problem the data module opens with.

- [Horizontal vs Vertical Scaling: Which to Pick First](https://www.matthewswong.com/en/blog/horizontal-vs-vertical-scaling/)
- [Load Balancing Algorithms: Round Robin, Least Conn, IP Hash](https://www.matthewswong.com/en/blog/load-balancing-algorithms-explained/)
- [Cache-Aside vs Write-Through vs Write-Back: Which Fits?](https://www.matthewswong.com/en/blog/cache-aside-vs-write-through-caching/)
- [Cache Invalidation Strategies: TTL, Events and Versioned Keys](https://www.matthewswong.com/en/blog/cache-invalidation-strategies/)
- [How a CDN Works: What to Cache at the Edge and What Not To](https://www.matthewswong.com/en/blog/how-cdn-works-edge-caching-explained/)
- [Consistent Hashing Explained: Hash Ring and Virtual Nodes](https://www.matthewswong.com/en/blog/consistent-hashing-explained/)

## Module 3: Data at scale

With the stateless tier scaled, the database becomes the bottleneck, and it is the hardest part to scale because it holds state. The order runs from the cheapest fix to the most expensive: the right model, indexes, replication and its lag, then partitioning and sharding, distributed IDs, and Bloom filters that stop needless lookups.

- [SQL vs NoSQL: How to Choose a Database for a New System](https://www.matthewswong.com/en/blog/sql-vs-nosql-how-to-choose/)
- [Database Indexing Explained: How B-Trees Work in Postgres](https://www.matthewswong.com/en/blog/database-indexing-b-tree-explained/)
- [Database Replication Explained: Leader-Follower, Sync vs Async](https://www.matthewswong.com/en/blog/database-replication-leader-follower/)
- [Read Replicas Return Stale Data: Handling Replication Lag](https://www.matthewswong.com/en/blog/read-replicas-replication-lag-pitfalls/)
- [Database Partitioning vs Sharding: What Is the Difference?](https://www.matthewswong.com/en/blog/database-partitioning-vs-sharding/)
- [Distributed ID Generator: Snowflake vs UUIDv7 vs ULID](https://www.matthewswong.com/en/blog/distributed-id-generator-snowflake-uuid/)
- [Bloom Filter Explained: Where It Fits in System Design](https://www.matthewswong.com/en/blog/bloom-filter-explained-system-design/)

## Module 4: Consistency, transactions and coordination

The data module made copies and splits; now you have to ask what correct means once data lives in more than one place. The module widens in steps, from guarantees on one node to replicated data to data spread across services, and ends with Raft, which explains how coordination services avoid the split-brain the replication post warned about.

- [ACID vs BASE: Database Consistency Models and When It Matters](https://www.matthewswong.com/en/blog/acid-vs-base-database-consistency/)
- [Transaction Isolation Levels Explained in PostgreSQL](https://www.matthewswong.com/en/blog/database-transaction-isolation-levels-explained/)
- [CAP Theorem Explained: How It Shapes Your Database Choice](https://www.matthewswong.com/en/blog/cap-theorem-explained-practical-examples/)
- [Eventual Consistency Explained: When Is Stale Data Acceptable?](https://www.matthewswong.com/en/blog/eventual-consistency-explained/)
- [Two-Phase Commit vs Saga: Distributed Transactions Compared](https://www.matthewswong.com/en/blog/two-phase-commit-vs-saga/)
- [Leader Election in Distributed Systems: Leases and Fencing](https://www.matthewswong.com/en/blog/leader-election-distributed-systems/)
- [Raft Consensus Algorithm Explained: Elections and Logs](https://www.matthewswong.com/en/blog/raft-consensus-algorithm-explained/)

## Module 5: Reliability: fail well

By now your design has many parts, and some part is always failing. The module first sets how reliable the system must be, so redundancy is sized to a target rather than to fear, then covers failover and the patterns that stop one failure from spreading: retries done right, bulkheads, backpressure and rate limiting at the edge.

- [SLI vs SLO vs SLA: Definitions, Error Budgets and Burn Rates](https://www.matthewswong.com/en/blog/slo-sli-sla-reliability-explained/)
- [High Availability Design: Redundancy, Failover and the Nines](https://www.matthewswong.com/en/blog/high-availability-redundancy-failover-design/)
- [Retry with Exponential Backoff and Jitter in TypeScript](https://www.matthewswong.com/en/blog/retry-exponential-backoff-jitter/)
- [Bulkhead Pattern Explained: Isolate Failures in Backend Systems](https://www.matthewswong.com/en/blog/bulkhead-pattern-fault-isolation/)
- [Backpressure in Distributed Systems: Stop a Fast Producer](https://www.matthewswong.com/en/blog/backpressure-distributed-systems-explained/)
- [Token Bucket vs Sliding Window: Rate Limiting Algorithms](https://www.matthewswong.com/en/blog/rate-limiting-algorithms-token-bucket-sliding-window/)

## Module 6: Service boundaries and communication

You can only judge when to split a system after seeing what distribution costs: lost atomicity, partial failure and retries. So the module opens with the default, a modular monolith, then shows how to find boundaries, how the parts talk, the plumbing separate services need, and how to migrate an existing monolith with the strangler fig.

- [Modular Monolith Architecture: When It Beats Microservices](https://www.matthewswong.com/en/blog/modular-monolith-architecture-guide/)
- [Bounded Contexts in Domain-Driven Design and How to Find Them](https://www.matthewswong.com/en/blog/domain-driven-design-bounded-contexts-explained/)
- [Hexagonal Architecture (Ports and Adapters) in TypeScript](https://www.matthewswong.com/en/blog/hexagonal-architecture-ports-and-adapters/)
- [Sync vs Async Microservices Communication: How to Choose](https://www.matthewswong.com/en/blog/sync-vs-async-microservices-communication/)
- [Pub/Sub vs Message Queue: Differences and When to Use Each](https://www.matthewswong.com/en/blog/pub-sub-vs-message-queue/)
- [Service Discovery in Microservices: How It Works](https://www.matthewswong.com/en/blog/service-discovery-microservices-explained/)
- [Service Mesh vs API Gateway: Differences and When to Use Each](https://www.matthewswong.com/en/blog/service-mesh-vs-api-gateway/)
- [Strangler Fig Pattern: Monolith to Microservices Migration](https://www.matthewswong.com/en/blog/strangler-fig-monolith-to-microservices-migration/)

## Module 7: Case studies and the interview framework

Case studies only teach once the parts are familiar. The framework comes first so every case is practised with the same seven steps, then the cases run from read-heavy designs through real-time fan-out to correctness-critical systems. The key-value store is the capstone because it rebuilds consistent hashing, quorums, replication and Bloom filters into one system.

- [System Design Interview Framework: A Step-by-Step Approach](https://www.matthewswong.com/en/blog/system-design-interview-framework-step-by-step/)
- [Design a URL Shortener Like bit.ly: System Design Guide](https://www.matthewswong.com/en/blog/design-url-shortener-system-design/)
- [Design Search Autocomplete (Typeahead): Tries, Redis, Postgres](https://www.matthewswong.com/en/blog/design-search-autocomplete-typeahead/)
- [News Feed System Design: Fan-Out on Write vs Fan-Out on Read](https://www.matthewswong.com/en/blog/design-news-feed-fan-out-on-write-vs-read/)
- [Design a Chat App Like WhatsApp: Real-Time System Design](https://www.matthewswong.com/en/blog/design-chat-application-system-design/)
- [How to Design a Scalable Notification System (Push, Email, SMS)](https://www.matthewswong.com/en/blog/design-notification-system-architecture/)
- [Geohash vs Quadtree: How Nearby Driver Search Works](https://www.matthewswong.com/en/blog/geohash-quadtree-nearby-search-design/)
- [Design a Distributed Job Scheduler That Runs Each Job Once](https://www.matthewswong.com/en/blog/design-distributed-job-scheduler/)
- [Design a Web Crawler: URL Frontier, robots.txt and Dedup](https://www.matthewswong.com/en/blog/design-web-crawler-system-design/)
- [Design a Metrics and Monitoring System: A Prometheus Pipeline](https://www.matthewswong.com/en/blog/design-metrics-monitoring-system/)
- [Design a Video Streaming System: HLS, CDN and Adaptive Bitrate](https://www.matthewswong.com/en/blog/design-video-streaming-system-hls-cdn/)
- [Design a Flash Sale System That Never Oversells Stock](https://www.matthewswong.com/en/blog/design-flash-sale-inventory-system/)
- [Design a Payment System: Ledger, Idempotency, Reconciliation](https://www.matthewswong.com/en/blog/design-payment-system-ledger-reconciliation/)
- [Design a Distributed Key-Value Store, Dynamo-Style](https://www.matthewswong.com/en/blog/design-key-value-store-from-scratch/)

---

- HTML version: https://www.matthewswong.com/en/learn/system-design/
- Bahasa Indonesia: https://www.matthewswong.com/id/learn/system-design/
- Site index for agents: https://www.matthewswong.com/llms.txt
- Sitemap: https://www.matthewswong.com/sitemap.xml
- API description (OpenAPI): https://www.matthewswong.com/openapi.json
