What problem are you trying to solve?
Storage layout, distribution, and replication solve different problems. This chapter helps choose among them using access patterns, capacity, consistency, and recovery requirements.
Decision reference
| Requirement | Investigate |
|---|---|
| Selective row access | Indexes |
| Time pruning and lifecycle | Table partitioning |
| Related values stored together | Engine-specific clustering |
| Distributed capacity | Sharding |
| Read isolation or failover | Replicas and their consistency contract |
In this chapter
- Choose the right storage or scaling changeSeparate query access, physical layout, capacity, and availability requirements.
- Clustering means different thingsDistinguish BigQuery storage blocks, clustered indexes, PostgreSQL CLUSTER, and database clusters.
- Sharding and distribution keysChoose where data lives while accounting for routing, hot keys, joins, and growth.
- Replicas, freshness, and failoverSeparate read capacity from availability and define what a user may observe after a write.
Tie the change to a bottleneck
An index, partition, shard, replica, or clustering choice should answer a specific problem. State the bottleneck first, then the trade-off the change introduces. Do not treat these as interchangeable ways to “scale the database.”