Sharding and the partition key

Lesson 11 of 26 · Scale and reliability · 2 min Get the course to watch

Sharding splits one big database into several smaller ones, each holding part of the data. It is the move people reach for first in a design round, and it is the one you should reach for last, because it is very hard to undo.

Exhaust the cheaper options first: better indexes, caching, read replicas, and a bigger machine. Shard only when writes or data size genuinely outgrow one primary, and you can say which.

The rest of this lesson

  • The key is the design
  • Hash or range
  • Hot tenants and resharding
  • What you give up

The full lesson is animated and narrated, with a short quiz, and you can pause it to ask a question. It comes with System design for senior engineers, AI systems included.