Try
↑ ↓ move↵ openesc close

Curriculum · Module 02, Databases and Replication

Lesson 3 · 7 topics · 40 min · Intermediate · 0/7 done

Partitioning

Cut the data into pieces by key range or by hash. See which one makes hot spots, which one makes range scans cheap, and what a split can and cannot fix.

What each topic covers

  • Replication copies everything everywhere. When one machine cannot hold or write it all, the data has to be cut into pieces.
  • Two ways to decide which partition owns a key, what each does to scans and hot spots, and how a hot range is split.
  • Run range and hash on uniform, sequential and skewed keys, count partitions per scan, and split the busiest range.
  • Measured imbalance for each rule and traffic shape, what hashing costs range scans, and the floor a split cannot cross.
  • What it costs to move data when a machine joins or dies, why many small partitions beat hash mod N, and how a client learns where a key lives.
  • A local index makes writes cheap and reads fan out to every partition. A global index does the reverse. The tail-latency arithmetic of fan-out.
  • Three quick checks on sequential keys, scans under hashing and a single popular product, plus the papers behind the lesson.

Topics

  1. 1Too much data, too many writes4 min
  2. 2Range, hash, and splitting6 min
  3. 3Split a hot range and compare layouts8 min
  4. 4When one key outruns every partition6 min
  5. 5Adding a node, and how requests find their partition6 min
  6. 6Looking up by the column you did not partition on6 min
  7. 7Check the partitioning rules4 min

Practise this lesson

14 interview questions on partitioning, with worked answers and sources.

Practise these

Your progress is saved in this browser. Sign in to keep it on every device. Privacy · Terms