Cloud SQL can scale in the following ways:
- Vertical scaling:
- Increasing the amount of computing resources (such as CPU and memory) allocated to a single database instance.
- Can be done with a few clicks in the Cloud Console, and requires no downtime.
- Horizontal scaling:
- Adding additional read replicas to distribute read workloads and improve performance.
- Can be added on demand, and there’s no limit to the number of replicas that can be added.
Cloud SQL read replicas provide:
- Enhanced Disaster recovery. Can convert a read replica to the Primary (if the primary is no longer available)
- In terms of data closer to your app, you can have different connection strings for an application for different endpoints
- For example,:
- Read-Write connection strings will go to the primary
- Read only connections hit a local read replica
- For example,:
- If reads comprise most of the use case for your app, then accessing the local replica saves on data transfer and egress charges since you are not accessing the primary sitting in the eastern United States in this example