System Design Intermediate: Load, Databases, and Queues
Lesson promise
By the end of this lesson, the learner should be able to: choose a load-balancing algorithm for a given traffic pattern, explain the trade-offs between B-trees and LSM trees, and describe how a database write flows through the WAL, leader, and followers to durable storage.
Narration draft
Start with load balancing: contrast round-robin, least connections, and IP hash. Show how consistent hashing distributes keys across a ring, and why virtual nodes smooth out uneven placement. Then explain health checks: active checks that probe a /health endpoint, and passive checks that observe real traffic for failure rates.
Transition to databases: the write-ahead log as the durability contract, fsync as the floor for write latency, B-trees for read-heavy workloads, LSM trees for write-heavy ones. Explain leader-follower replication: writes go to the leader, reads can go to followers, and the lag between them is the staleness guarantee.
Finish with queues: at-most-once, at-least-once, exactly-once delivery semantics. Explain visibility timeout and consumer leases, and why poison pills need a dead-letter queue. Show how consistent hashing appears here too — partitioning a queue's keyspace across consumers.
Visual sequence
- Animate a request flowing through a load balancer to one of three backends. Show health checks removing and re-adding backends.
- Show a database write flowing: app → WAL fsync → apply to page → stream to follower → ack. Contrast sync vs. async replication.
- Show a queue: producer publishes, consumer picks up, visibility timeout expires if no ack, message reappears.
Companion material
Use the load balancer article, database article, queues article, request trace, database write trace, and the System Design Intermediate learning path as written references. The video remains planned until media and transcript are produced.
Related articles
Databases: Storage, Indexing, and Replication
From write-ahead logs to B-trees, from leader-follower to read replicas — how databases persist, index, and copy your data.
Consensus: How Nodes Agree Despite Failures
Why distributed systems need consensus, how Raft uses terms and quorums to elect a leader, and when the cost is worth paying.
Distributed Queues and Reliable Delivery
At-most-once, at-least-once, and exactly-once delivery semantics, dead-letter queues, and the cost of ordering in a queue.
More in System Design
System Design Advanced: Consensus, Sharding, and Failover
How Raft elects leaders under failure, how consistent hashing distributes shards, and how circuit breakers and multi-region failover keep systems alive.
DetailsSystem Design Foundations: From Idea to Execution Trace
A beginner-friendly walkthrough of what a software system is, why latency and throughput matter, and how a request actually travels from browser to server.
DetailsDesigning a Cache-Backed Read Path
A planned system-design walkthrough traces a product read through routing, a cache, a database, and freshness decisions.
DetailsNew lessons by email
Get new articles and notes on the systems behind everyday software.
One technical dispatch per week. No noise.
Not started
Sign in to save your learning progress.