CSE Roadmap

Specialist tier · about 2 hours · 5 parts

Part 2 of 5 · 1 min read

Why rebalancing is needed

Adding or removing nodes changes how many partitions exist, so data must move to keep the new set of nodes evenly loaded.

Think of a moving company reassigning which truck carries which boxes after a new truck joins the fleet. The new truck actually gets some boxes to carry, instead of sitting empty while the old trucks remain just as full as before.

In plain words: rebalancing is the process of moving data between partitions, usually because the number of nodes in a cluster has changed. Adding a node without rebalancing leaves the new node idle while existing nodes keep all their original load, defeating the purpose of adding capacity. Removing a node without rebalancing first would lose whatever data that node held, so rebalancing must move that data elsewhere before the node is actually removed.

A worked example. A cluster with 4 nodes, each holding a quarter of the data, adds a 5th node. Rebalancing moves roughly a fifth of the data from each existing node to the new one, so all 5 nodes end up holding roughly equal shares.

The key lines. No new SQL; rebalancing is an operational process a distributed database runs internally, not a statement issued against the data itself.

Rebalancing

Rebalancing is the process of moving data between partitions, typically triggered by a change in the number of nodes in a cluster, so that load stays evenly distributed across whatever nodes currently exist.

Example: a 5th truck joining a delivery fleet and being assigned some of the existing boxes to carry is rebalancing.