Topic · 16 lessons in 6 series
Scalability and distributed systems
Scaling past one machine: load balancing, replication, sharding, queues, Kafka, consistency and availability, and the trade-offs behind each choice.
DevOpsWhole series →
System DesignWhole series →
- Vertical vs Horizontal Scaling (and Why Stateless Wins)Bigger server or more servers? Vertical scaling is simple but hits a ceiling; horizontal scaling is nearly unlimited, but only once your app forgets everything between requests. Why stateless wins, and where state should live instead.8 min
- Latency, Throughput & Why p99 MattersAn 80 ms average can hide a checkout that freezes for five seconds. Latency, throughput and Little's Law, why queues explode near full utilisation, and why at scale the p99 becomes what most users feel.8 min
- Availability and "The Nines" Explained“Five nines” is 26 seconds of downtime a month. What the nines really mean, why chained dependencies multiply away your availability while redundancy multiplies it back, and why fast recovery is often the cheapest nine you can buy.8 min
- Message Queues: A Gentle IntroductionPlacing an order shouldn't wait on the email provider — or fail because SMS is down. How message queues let you do the essential work now and everything else reliably a moment later, with acks, retries, dead-letter queues and back pressure.7 min
- Database Replication: Leader, Follower and BeyondOne database server will eventually die, drown in reads, or be too far from your users. How leader-follower replication works, what replication lag does to real users, why failover is so hard, and how multi-leader and quorum systems handle conflicts.12 min
- Sharding: Splitting Data Across MachinesIndexes tuned, biggest server bought, replicas added — and the primary still drowns in writes. How sharding splits one dataset across machines, the four strategies, how to pick a shard key, and the hard problems it creates.12 min
- Consistency Models: Strong, Eventual and In Between“Eventually consistent” can mean your own comment vanishes on refresh. Consistency is a spectrum, not a switch: linearizable, causal, session guarantees and eventual — what each promises, how conflicts get merged, and why clocks can't be trusted.10 min
- Queues vs Pub/Sub“One of you handles this” or “all of you get a copy”? Mix them up and orders go unpacked, or customers get five emails. Queues vs pub/sub, how real systems combine both, push vs pull, per-key ordering, and delete vs keep.8 min
- Apache Kafka FundamentalsThirty services all need each other's data, and the data team wants to replay last week. How Kafka's simple idea — a partitioned, replicated, append-only log — became the backbone of event streaming: topics, keys, offsets, consumer groups, retention and compaction.12 min
- Background Jobs, Retries & Dead-Letter QueuesBackground jobs are easy to start and surprisingly easy to get wrong: poison jobs, retry storms, cron that runs twice, deploys that kill half-done work. How to design jobs, retry only what can succeed, and route what can't to a dead-letter queue you actually watch.10 min
Practical Design ProblemsWhole series →
Full-Stack QuestionsWhole series →
System Design Case Studies 2Whole series →
- Design a System Across Multiple Data CentresActive-passive versus active-active, DNS steering, sync versus async replication, split brain and failback, with an RPO simulation.15 min
- From One User to Millions: Scaling a Web App on AWSTen scaling stages with trigger, change and cost, the metric that tells you, AWS services in plain words, and a queueing arithmetic demo.20 min