Cianplan

Level 2: Data · L2.3 Partitioning / sharding & consistent hashing

Range vs hash partitioning

Choose a partition key and predict hotspots.

12 min · Pro

What you take away

  • Range partitioning keeps keys in order, so range scans are cheap and sequential keys send every write to one partition.

And 3 more inside the class, in Pro.

How the class is laid out

  1. The problem
  2. The simple version
  3. What each one buys
  4. The compound key resolves it
  5. Check your understanding