Search⌘ K
AI Features

Algorithms for Horizontal Partitioning

Understand different algorithms for horizontal partitioning including range partitioning, hash partitioning, and consistent hashing. Learn how each algorithm distributes data across nodes, their advantages and disadvantages, and how they affect query performance and system scalability. This lesson helps you gain insight into balancing load and handling data distribution when designing distributed systems.

There are a lot of different algorithms we can use to perform horizontal partitioning. We will study some of these algorithms, and discuss their advantages and drawbacks.

Range partitioning

Range partitioning is a technique where we split a dataset into ranges according to the value of a specific attribute. We then store each range in a separate node. The case we described in the previous lesson—with the alphabetical split—is an example of range partitioning.

Of course, the system should store and maintain a list of all these ranges and map which node stores a specific range. In this way, the system consults this node map whenever the system receives a request for a specific value (or a range of values) to identify which node (or nodes, respectively) the request should be redirected to.

Advantages of range partitioning

Some advantages of range partitioning include:

  • Simplicity and ease of implementation.

  • The ability to perform range queries using the partitioning key value.

  • A good performance for range queries that use the partitioning key, when the queried range is small and resides in a single node.

  • Makes adjusting ranges (repartitioning) ...