You are on page 1of 1

# 6.

Partitioning (Sharding) (18)

Is for achieving scalability. Each partition is a small database on its own. But the db can support
operations involving multiple partitions at the same time.

## Summary

Partitioning scheme should depend on your data. The goal is to avoid hot spots (disproportional
high load).

Partitioning approaches:

- Key range partitioning

- sort keys, so that range queries are e cient

- allocate key ranges to partitions

- there is a risk of hot spot

- partitions rebalanced dynamically by splitting the range into 2 subranges and adding new
partitions

- Hash partitioning

- hash func is applied to each key

- partition owns a range of hashes

- range queries are not e cient, but load is more even

- usually number of partitions is xed, but dynamic partitioning can also be used

- each node can have several partitions

ffi
fi
ffi

You might also like