Chapter 23: Placement

Placement determines where in the physical infrastructure a piece of data or a computation should live. Good placement reduces latency (by putting data close to its consumers), improves reliability (by spreading replicas across failure domains), and optimizes resource usage (by balancing load across machines).

Data placement strategies include hashing (using a hash function to deterministically assign data to servers), range partitioning (assigning contiguous key ranges to servers), and directory-based placement (consulting a lookup service for each key). Our discovery service acts as a simple directory for service placement, though it operates at the service level rather than the data level.

Consistent hashing is a particularly important technique for data placement. It assigns both servers and keys to positions on a virtual ring, and each key is stored on the next server clockwise on the ring. When a server is added or removed, only a fraction of keys need to be reassigned, minimizing data movement.

Placement must account for failure domains: the physical or logical boundaries within which failures are correlated. A rack failure affects all servers in the rack; a power failure affects all racks in a power domain; a building failure affects all power domains in the building. Placing all replicas of critical data in the same rack defeats the purpose of replication.

The region is the largest failure domain. Distributing across geographic regions protects against disasters that affect an entire datacenter. Chapter 24: Geo Replication describes how our system runs a full stack in each region, with federated discovery and WAL-based replication bridging the gap.