System Design
6 posts
Sharding: How Databases Scale Horizontally
Using a restaurant-chain analogy, this post explains how sharding splits data across multiple machines, compares common sharding strategies and their tradeoffs, and covers the problems that show up once you've sharded.
Caching: Put Data Closer, Get Speed — and New Problems
Starting from a database that can't keep up with repeated queries, this post breaks down how caching trades an extra storage layer for speed, plus the read/write strategies like Cache-Aside and Write-Through, and the consistency-vs-performance tradeoffs behind eviction and invalidation.
Replication: Copying Your Database, Without Sacrificing Performance or Consistency
Starting from the fact that a single database can neither handle heavy traffic nor survive a failure, this post digs into how replication spreads data across multiple machines to ease that load, and the consistency tradeoffs behind leader-follower architecture, synchronous vs. asynchronous replication, and failover.
Scalability: How a System Goes From Falling Over to Getting Sturdier as It Grows
Starting from a site that crashes the moment traffic spikes, this post digs into what scalability actually means, and the tradeoffs behind common approaches like vertical scaling, horizontal scaling, caching, and database sharding.
Idempotency: Why Retrying an API Call Should Not Break Things
Starting from a real-world network retry scenario, this post breaks down what idempotency actually means, why distributed systems cannot avoid it, and how to design APIs that survive being called more than once using an idempotency key.
The CAP Theorem — Why Distributed Systems Can't Have It All
A bank-branch deposit scenario that breaks down what Consistency, Availability, and Partition Tolerance actually mean, why "pick two" is misleading, and how to actually choose in practice.