SD Mastery
.
course
prep
arena
ask
shorts
stories
you
?
Search lessons, topics…
⌘K
?
L1
· Intern
0 / 100 xp → junior
~
course
prep
arena
ask
shorts
stories
you
Loading page…
~/himanshu
tty1
~/himanshu
$
cd ~/next-page
[ok]
resolve route
[
..
]
stream page
← all concepts
Hash partitioning
.
also: hash-based partitioning · hash sharding · hash-based sharding
Placing each key on partition hash(key) mod N: even spread and O(1) lookup, but no range queries.
the two-minute refresher
partition = hash(key) % number_of_partitions.
Strengths: a good hash spreads data evenly, and any client computes the partition itself.
Weakness: a range (IDs 1000-2000, 'URLs from the last hour') touches every partition.
Changing N moves most keys: 'resharding hell', which consistent hashing fixes.
Where the course teaches it
W01 · Day 1
Partitioning Deep-Dive
learn it →
Related concepts
Range partitioning
Consistent hashing
Resharding
Notebook
Ask