Create Cloud SQL read replicas
Creating read replicas in Cloud SQL allows you to offload read-heavy workloads from your primary instance, improving performance and scalability. Here’s how you would theoretically create Cloud SQL read replicas:
-
Accessing Cloud SQL: Open the Google Cloud Console and navigate to the Cloud SQL page.
-
Select the Primary Instance: Choose the primary Cloud SQL instance from which you want to create a read replica.
-
Navigate to Replicas: Within the instance details page, locate the “Replicas” tab or section.
-
Click on “Create Replica”: Click on the “Create Replica” button to initiate the creation process.
-
Configure Replica Settings: Provide the necessary configuration details for the read replica, including:
- Replica name: Specify a unique name for the read replica.
- Region: Choose the region where you want to deploy the replica.
- Machine type: Select the machine type and storage capacity for the replica.
- Automatic backups: Choose whether to enable automatic backups for the replica.
Prerequisites
GCP account
Open Console.
Menu > SQL
![](https://prwatech.in/blog/wp-content/uploads/2021/05/image-377.png)
the SQL instance
![](https://prwatech.in/blog/wp-content/uploads/2021/05/image-378.png)
Click on Replicas.
![](https://prwatech.in/blog/wp-content/uploads/2021/05/image-379.png)
Click on Create Read Replica.
![](https://prwatech.in/blog/wp-content/uploads/2021/05/image-380.png)
Give the instance ID for replica.
Choose the region.
multiple zone will not be available. It is used for production instances.
![](https://prwatech.in/blog/wp-content/uploads/2021/05/image-381.png)
Click on Show Configuration Options.
![](https://prwatech.in/blog/wp-content/uploads/2021/05/image-382.png)
Choose the specification for the replica instance.
![](https://prwatech.in/blog/wp-content/uploads/2021/05/image-383.png)
Choose public IP. If you want private IP you have to enable API and permissions.
Give any network
![](https://prwatech.in/blog/wp-content/uploads/2021/05/image-384.png)
Click create replica.
It will take around 5 minute to create.
![](https://prwatech.in/blog/wp-content/uploads/2021/05/image-385.png)
The replica will be created.
![](https://prwatech.in/blog/wp-content/uploads/2021/05/image-386.png)
To disable replica open the replica and press Disable replication
![](https://prwatech.in/blog/wp-content/uploads/2021/05/image-387.png)
Click Disable
![](https://prwatech.in/blog/wp-content/uploads/2021/05/image-388.png)
To delete Replica, Press Delete.
![](https://prwatech.in/blog/wp-content/uploads/2021/05/image-389.png)
Give the Replica ID and press delete. The Replica will be deleted
![](https://prwatech.in/blog/wp-content/uploads/2021/05/image-390.png)
Create Cloud SQL read replicas