Diagram
A decision tree branching on read vs write pressure and app constraints to choose between Cloud SQL read replica, Spanner nodes, or sharding.
Choosing Between Horizontal Scaling Approaches
The three horizontal approaches differ by what they scale and what tradeoff they impose on operations and applications:
| Approach | What it scales | Key tradeoff |
|---|---|---|
| Cloud SQL read replica | Concurrent reads | Application must change to route read queries to the replica |
| Cloud Spanner node and PU increase | Reads, writes, and storage allotment | Higher compute cost and storage limit of 10 TiB per node |
| Database sharding | Writes and reads | Re-architecture, migration, and hotspot risk |
Choose a Cloud SQL read replica when the primary is read-bound and the application can separate read traffic from write traffic. Choose additional Spanner nodes or PUs when throughput, latency, or storage growth requires more distributed capacity across zones without changing the application sharding logic.
Domain 2 of 5
21 practice questions
Practice this DomainLast updated