How To Promote Read Replica To Standalone DB Instance
As i described in my previous posts , You can easily create a read replica from RDS DB instance using AWS console.
Additionally you can add more replicas to increase the performance of the high read operations.
In this guide , We will learn how we can promote the read replica to Standalone RDS DB instance.
You can also check how to,
migrate RDS instance to another region
migrate RDS instance to another account
What Happens After Promotion?
- Replication from the current master DB instance stops
- The read replica becomes standalone RDS DB instance
Reason For Promoting Read Replica To Standalone DB Instance
- To perform DDL operations – Certain operations such as creating and rebuilding indexes will cause performance issues in the master DB instance.To over come that Once the replica is in sync with the master DB instance , We can perform the index actions and then promote the read replica to master and direct all the traffic to this promoted DB instance.
- Implementing failure recovery – We can use read replica as a data recovery option if the source RDS DB instance fails.It starts by creating read replica , Promoting it to standalone instance and directing the traffic to this instance.
- Sharding – It is a type of database partitioning that separates very large databases the into smaller parts , We can achieve the same by sharding the tables into different read replicas and promoting them to standalone instance when required.
Promoting Read Replica To Standalone Instance
Amazon Relational Database service provides various options for data recovery and high availability during failures such as Multi-AZ deployment , Point in time recovery.
But It’s recommended to have Multi-AZ RDS setup to avoid failures such as failover , replication and automatic failure detection.
How Does Manual Failover Works?
In case of master RDS DB instance fails , We have follow the below steps.
- Promote the Read replica to master
- Direct all the traffic to the new master DB instance
- setup a replica for this DB instance
The following databases are supported for promoting to standalone DB instance from read replica.
MySQL, MariaDB, Oracle, PostgreSQL, and SQL Server.
To promote read replica to standalone DB instance , Login to RDS console.
In the left Navigation pane , choose Databases
Select the read replica and you can see the role of the instance be Replica
Then Under Actions , Click Promote
On the Promote Read replica page , Enable Automated backup and provide the retention period and the backup window for the new RDS DB instance.
and then click Continue , then choose Promote read replica
By this time , The status of the instance will be Modifying
Once the read replica is promoted to Standalone DB Instance , The role of the instance will become Instance.
Now we can use the endpoint of this instance to direct all the traffic to this DB instance.
We have learnt how we can promote the read replica to Standalone RDS DB instance.
Hope you find it helpful.Please check out my other publications.