Course contentsShow
← System Design
Lesson 1478 of 1,91936. Data Partitioning Strategies in DepthFree lesson

Directory Partitioning Flexibility

Enabling arbitrary partition assignment and dynamic rebalancing through indirection.

Directory Partitioning Flexibility

You'll learn how directory-based partitioning enables arbitrary partition-to-node assignment and seamless rebalancing through a layer of indirection.

The Power of Indirection

In Directory Partitioning (introduced in lesson 1476), a lookup table maps partition IDs to physical nodes. The key advantage? Flexibility. Unlike hash-based or range-based schemes where the mapping is algorithmic, directory partitioning lets you assign any partition to any node—there's no mathematical formula constraining placement.

This indirection layer acts like a forwarding service: when a request arrives, you first consult the directory to see which node currently owns that partition, then route accordingly.

Arbitrary Assignment

Need to place three hot partitions on your most powerful server? Easy—just update the directory. Want to keep related partitions co-located for cross-partition queries? Update the directory. Want to isolate a problematic tenant? Again, update the directory.

This arbitrary assignment is impossible with pure hash or range partitioning, where partition ownership is calculated, not configured.

Dynamic Rebalancing Without Downtime

When you need to rebalance—whether adding nodes, removing failed hardware, or redistributing load—the directory makes it straightforward:

  1. Allocate new partition assignments in the directory
  2. Begin copying data to new nodes in the background
  3. Update directory entries atomically once copy completes
  4. New requests automatically route to new locations

No hash ring recalculation. No key range redistribution math. Just update the lookup table.

The Analogy

Think of it like a phone directory: you don't derive someone's number from their name using a formula. You look it up. If they change numbers, you update one entry—callers automatically reach the new number.

Key Takeaway:
Directory partitioning trades the simplicity of algorithmic mapping for maximum flexibility—you can assign any partition to any node and rebalance by simply updating a central lookup table, enabling sophisticated placement strategies impossible with pure hash or range schemes.