System design

How big apps are built to stay fast and stay up.

79 lessons in 10 parts · 74 ready to watch

Start with lesson 1

Numbers and failure

How fast, how big, and how often things break.

  1. Latency and percentiles
  2. Capacity estimation
  3. Availability and the nines
  4. Scaling up vs scaling out
  5. Single points of failure

Getting traffic in

Getting millions of visitors to the right server.

  1. Load balancing
  2. Health checks and heartbeats
  3. Stateless services and sessions
  4. DNS
  5. Reverse proxy and API gateway
  6. Rate limiting
  7. Sessions vs tokens
  8. REST vs GraphQL
  9. Pagination: offset vs cursor
  10. Polling, SSE and WebSockets

Caching

Keeping answers close, so nobody waits twice.

  1. Caching (cache-aside)
  2. Eviction (LRU)
  3. Invalidation and TTL
  4. Write-through and write-behind
  5. Cache stampede
  6. Hot keys
  7. CDN

Storing data

How a database saves, finds and protects things.

  1. Relational vs document
  2. Graph databases
  3. Indexes (B-tree)
  4. Write-ahead log
  5. LSM-trees
  6. Transactions (all or nothing)
  7. Isolation levels
  8. Optimistic vs pessimistic locking
  9. Denormalization
  10. Materialized views
  11. Object storage and direct uploads
  12. Search (inverted index)
  13. What a hash is

Scaling data

Copying and splitting data across many machines.

  1. Replication
  2. Replication lag and stale reads
  3. Failover and split brain
  4. Multi-leader and conflict resolution
  5. Sharding and shard keys
  6. Consistent hashing
  7. Unique ID generation
  8. Going multi-region

Agreeing on the truth

Getting many machines to agree on one answer.

  1. Strong vs eventual consistency
  2. CAP
  3. Quorums
  4. Logical clocks
  5. Leader election
  6. Consensus (Raft)
  7. Distributed locks and fencing
  8. Two-phase commit
  9. Sagas
  10. Gossip
  11. Merkle trees

Doing work later

Queues and workers, so slow jobs never block you.

  1. Message queues
  2. Long-running jobs and workers
  3. Publish and subscribe
  4. Partitions and message order
  5. Delivery guarantees and idempotency
  6. Dead-letter queues
  7. Backpressure
  8. Dual writes and the outbox
  9. Change data capture
  10. Event sourcing and CQRS
  11. Batch vs stream processing

Staying up when things break

Timeouts, retries and staying up when parts fail.

  1. Timeouts
  2. Retries with backoff and jitter
  3. Circuit breakers
  4. Degrading gracefully
  5. Bulkheads
  6. Load shedding
  7. Metrics and alerts
  8. Logs and distributed tracing
  9. SLOs and error budgets

Clever structures

Small tricks that answer very big questions.

  1. Bloom filterssoon
  2. Counting at scale (HyperLogLog, count-min)soon
  3. Geohash and quadtreessoon

Shaping the system

When to split one app into many services.

  1. Monolith vs microservicessoon
  2. Service discoverysoon