Skip to main content

Notes on DDIA Chapters 5-6: Replication and Partitioning

1 min read

Replication (Ch. 5)

Three approaches, each with a different failure mode:

StrategyFailure mode
Single-leaderLeader outage = no writes
Multi-leaderWrite conflicts need resolution
LeaderlessRead repair or anti-entropy needed

The surprising takeaway: single-leader is still the right default for most systems. Multi-leader and leaderless are solutions to specific geographic or availability problems, not general upgrades.

Partitioning (Ch. 6)

Key insight: partitioning strategy determines operational complexity.

  • Hash-based (by key hash): Simple, even distribution. Bad for range queries.
  • Range-based (by key range): Good for scans. Risk of hotspots.
  • Skewed partitions are the silent killer — one hot partition defeats the purpose.

What I learned

The chapter on partitioning changed how I think about database schema design. If you know your access pattern, you can choose a partition key that makes most queries hit one partition. If you don’t, hash partitioning is safer.