3 modules · 45 topics

System design

Learn the core mechanisms, model software, and design systems that hold up under load.

A distributed system architecture showing client ingress, an API gateway load balancer, clustered microservices, a distributed cache, an event stream queue, and a partitioned database cluster.
Distributed components working together under load.

Core Concepts

Communication, storage, capacity, and distributed systems, explained through working examples and the tradeoffs behind them.

  1. 01

    Request and Response

    Read HTTP contracts, reuse connections, validate inputs, and distinguish a failed response from a failed operation.

  2. 02

    DNS and CDN

    Follow name resolution and edge caching, then test cache keys, revalidation, expiry, and private responses.

  3. 03

    Load Balancers and API Gateways

    Route traffic, check backend health, drain connections, and place authentication and traffic policies at the right boundary.

  4. 04

    Parallelism and Concurrency

    Choose async tasks, threads, or processes; coordinate shared state and bound work without losing cancellation.

  5. 05

    Storage

    Choose storage by access pattern, durability, and interface, from memory and disks to databases and object stores.

  6. 06

    Numbers to Know

    Use dated hardware and AWS specifications to check CPU, memory, network, storage, and availability budgets.

  7. 07

    Back-of-the-Envelope Calculations

    Turn product activity into request rates, concurrent work, throughput, and storage growth with explicit assumptions.

  8. 08

    Indexes and MVCC

    Inspect query access paths, order composite indexes, and test snapshot visibility and conflicting updates.

  9. 09

    Caching

    Balance latency and freshness with cache strategies, eviction, bounded single-flight, and expiry jitter.

  10. 10

    Queues and Retries

    Handle acknowledgements, duplicate work, outbox delivery, retry budgets, and poison messages.

  11. 11

    Distributed Systems and CAP

    Reason about partial failure, linearizability, and availability during a network partition.

  12. 12

    Replication

    Follow writes across replicas and examine lag, acknowledgement, failover, fencing, and recovery.

  13. 13

    Sharding

    Choose partition keys, expose skew, route requests, and move data while preserving query and write boundaries.

  14. 14

    Errors, Logs and Telemetry

    Connect frontend failures to backend logs, metrics, and traces while controlling cardinality and sensitive data.

  15. 15

    Tokens, Embeddings and RAG

    Count tokens, compare vectors, and build retrieval with access filters, context budgets, freshness, and evaluation.

Low-level design

Design objects, protect state, and handle real-world edge cases.

  1. 01

    Parking Lot

    Compatible allocation and ticket lifecycle

  2. 02

    Vending Machine

    Atomic purchase and credit ownership

  3. 03

    Library Management System

    Title identity, copies, and loan ownership

  4. 04

    LRU Cache

    Recency ownership and bounded cache state

  5. 05

    Rate Limiter

    Per-client sliding windows and explicit time

  6. 06

    Banking System

    Atomic transfers, validation, and idempotency

  7. 07

    Transactional Key-Value Store

    Nested transactions and rollback boundaries

  8. 08

    In-Memory Database

    TTL, conditional updates, and version history

  9. 09

    Document Search Engine

    Tokenization, positional indexes, and stale updates

  10. 10

    Task Scheduler

    Priority dispatch, worker quotas, and expiring leases

  11. 11

    Recipe Manager

    Permissions and immutable revision history

  12. 12

    Message Broker

    Independent delivery state and bounded retries

  13. 13

    File Storage System

    Quota accounting and explicit expiration

  14. 14

    Meeting Room Booking System

    Interval conflicts and atomic room allocation

  15. 15

    Expense Sharing System

    Integer accounting and idempotent operations

High-level design

Diagram services, data flows, and failure paths in Excalidraw.

  1. 01

    URL Shortener

    Authoritative claims and cached reads

  2. 02

    API Rate Limiter

    Shared quotas and outage policy

  3. 03

    Distributed Cache

    Stable routing during topology changes

  4. 04

    Distributed Key-Value Store

    Quorum reads and version reconciliation

  5. 05

    File Storage Service

    Multipart integrity and publication

  6. 06

    Content Delivery Network

    Cache identity, freshness, and refresh ownership

  7. 07

    Distributed Message Queue

    Partition ownership and contiguous consumer commits

  8. 08

    Notification Service

    Transactional outbox and bounded provider retries

  9. 09

    Chat System

    Conversation sequence, retries, and reconnect cursors

  10. 10

    News Feed

    Hybrid fanout and stable feed pagination

  11. 11

    Video Streaming Platform

    Versioned jobs and complete manifest publication

  12. 12

    Web Crawler

    Fair host scheduling and retry eligibility

  13. 13

    Search Engine

    Partitioned ranking and index visibility

  14. 14

    Metrics and Monitoring System

    Bounded cardinality and mergeable histograms

  15. 15

    Ticket Booking System

    Expiring ownership and payment compensation