How to manage Read Replicas
A Read Replica is a live copy of a Database Instance that behaves like an Instance, but that only allows read-only connections. The replica mirrors the data of the primary Database node and any changes made are replicated to the replica asynchronously.
Read Replicas allow you to scale your Database Instance for read-heavy database workloads. They can also be used for business intelligence workloads.
Before you start
To complete the actions presented below, you must have:
- A Scaleway account logged into the console
- Owner status or IAM permissions allowing you to perform actions in the intended Organization
- A PostgreSQL or MySQL Database Instance
Create a Read Replica
-
Click PostgreSQL and MySQL under Databases on the side menu. A list of your Database Instances displays.
-
Select the geographical region of the Instance you want to manage from the drop-down.
-
Click the database name or more icon > More info to access the Database Instance information page.
-
Scroll down to the Read Replica section.
-
Click Create Read Replica. A pop-up displays.
-
Select the Availability Zone (AZ) configuration. Two configurations are available:
- Same AZ: Your Read Replica is hosted in the same AZ as your main Database Instance. We recommend this option for low-latency workflows.
- Multi-AZ: Your Read Replica is hosted in a different AZ, ensuring the resilience of your Replica. We recommend this option for ensuring the availability of your infrastructure, and improving your disaster recovery plan.
-
Select the network type. Two types are available:
- Public network - Resources in a public network are publicly visible by default. The default Access Control List (ACL) settings allow anybody to connect to resources in your network. You can restrict access by configuring ACLs in the Allowed IPs section.
- Private Networks - Private Networks allow you to create virtual Private Networks for your Databases, enabling them to communicate in an isolated network without the need for a public IP address. If you select this option, you must select an existing Private Network to attach to your Read Replica.
-
Click Create Read Replica. A list of your Read Replicas displays.
How to resync a Read Replica
When you resync a Read Replica, first it is reset, and then its data is resynchronized from the primary node. Your Read Replica will be unavailable during the resync process. The duration of this process is proportional to your Database Instance size. The configured endpoints will not change.
- Click PostgreSQL and MySQL under Databases on the side menu. A list of your Database Instances displays.
- Select the geographical region of the Instance you want to manage from the drop-down.
- Click the database name or more icon > More info to access the Database Instance information page.
- Scroll down to the Read Replica section.
- Click more icon > Resync next to the name of the Read Replica you want to resync. A pop-up displays.
- Make sure you have selected the correct Read Replica and click Resync. The list of your Read Replicas displays.
How to promote a Read Replica
It is possible to promote a Read Replica node to a standalone Database Instance.
-
Click PostgreSQL and MySQL under Databases on the side menu. A list of your Database Instances displays.
-
Select the geographical region of the Instance you want to manage from the drop-down.
-
Click the database name or more icon > More info to access the Database Instance information page.
-
Scroll down to the Read Replica section.
-
Click more icon > Promote Read Replica next to the name of the Read Replica you want to promote. A pop-up displays.
-
Click Promote Read Replica.
-
Go back to the list of your Database Instances. The promoted Read Replica appears.
How to manage Private Networks
You can attach and detach your Read Replica to a Private Network even after its creation.
Attach your Read Replica to a new Private Network
- Click PostgreSQL and MySQL under Databases on the side menu. A list of your Database Instances displays.
- Select the geographical region of the Instance you want to manage from the drop-down.
- Click the database name or more icon > More info to access the Database Instance information page.
- Scroll down to the Read Replica section.
- Click more icon > Attach Private Network next to the name of your selected Read Replica. A pop-up displays.
- Select Create and attach a new Private Network.
- Click Attach Private Network.
Attach your Read Replica to an existing Private Network
- Click PostgreSQL and MySQL under Databases on the side menu. A list of your Database Instances displays.
- Select the geographical region of the Instance you want to manage from the drop-down.
- Click the Database Instance name or more icon > More info to access the Database Instance information page.
- Scroll down to the Read Replica section.
- Click more icon > Attach Private Network next to the name of your selected Read Replica. A pop-up displays.
- Select an existing Private Network to attach to your Read Replica.
- Click Attach to Private Network to confirm.
Detach your Read Replica from a Private Network
If you already have an attached Private Network, you can detach it from your Read Replica.
- Click PostgreSQL and MySQL under Databases on the side menu. A list of your Database Instances displays.
- Select the geographical region of the Instance you want to manage from the drop-down.
- Click the database name or more icon > More info to access the Database Instance information page.
- Scroll down to the Read Replica section.
- Click more icon > Detach Private Network next to the name of your selected Read Replica. A pop-up displays to ask if you are sure you want to detach the Private Network.
- Click Detach Private Network to proceed. The list of your Read Replicas displays. The private endpoint is removed.
How to delete a public endpoint
Refer to the How to delete a public endpoint documentation page to do so for your Read Replica.
How to delete Read Replicas
- Click PostgreSQL and MySQL under Databases on the side menu. A list of your Database Instances displays.
- Select the geographical region of the Instance you want to manage from the drop-down.
- Click the database name or more icon > More info to access the Database Instance information page.
- Scroll down to the Read Replica section.
- Click more icon > Delete. A pop-up appears.
- Click Delete Read Replica to do so. The list of your Read Replicas displays.