Skip to main content

Deploying an Amazon RDS Multi-AZ and Read Replica

Hands-On Lab

 

Photo of Mark Richman

Mark Richman

AWS Training Architect II in Content

Length

01:30:00

Difficulty

Intermediate

Welcome to this live hands-on AWS lab, where we will be working with the Relational Database Service (RDS). <!-- NOTE: This lab may take 10-15 minutes to provision. --> This lab will provide you with hands-on experience with: - Enabling Multi-AZ and backups - Creating a read replica - Promoting a read replica - Updating the RDS endpoint in Route 53 Multi-AZ and read replicas serve different purposes with RDS. Multi-AZ is strictly for failover, as the standby instances cannot be read from by an application. Read replicas are used for improved performance and migrations. With read replicas, you can write to the primary database and read from the read replica. Because a read replica can be promoted to be the primary database, it makes for a great tool in disaster recovery and migrations. Good luck, and enjoy the hands-on lab!

What are Hands-On Labs?

Hands-On Labs are scenario-based learning environments where learners can practice without consequences. Don't compromise a system or waste money on expensive downloads. Practice real-world skills without the real-world risk, no assembly required.

Deploying an Amazon RDS Multi-AZ and Read Replica

Introduction

Welcome to this live hands-on AWS lab, where we will be working with the Relational Database Service (RDS).

<!-- NOTE: This lab may take 10-15 minutes to provision. -->

This lab will provide you with hands-on experience with:

  • Enabling Multi-AZ and Backups
  • Creating a read replica
  • Promoting a read replica
  • Updating the RDS endpoint in Route53

Solution

Log in to the live AWS environment using the credentials provided. Make sure you're in the N. Virginia (us-east-1) region throughout the lab.

Enable Multi-AZ Deployment

  1. Navigate to EC2 > Load Balancers.
  2. Copy the DNS name of the load balancer.
  3. Open a new browser tab, and enter the DNS name. We will use this web page to test failovers and promotions in this lab.
  4. Back in the AWS console, navigate to RDS > Databases.
  5. Click on our database instance.
  6. Click Modify.
  7. Under Multi-AZ deployment, click Yes.
  8. Change Backup Retention to 1 day, needed later for read replicas.
  9. Click Continue.
  10. Under Scheduling of modifications, select Apply immediately, and then click Modify DB Instance.
  11. Once the instance shows Multi-AZ is enabled (it could take about 10 minutes), select the database instance.
  12. Click Actions, and select Reboot.
  13. On the reboot page, select Reboot With Failover?, and click Reboot.
  14. Use the web page to monitor the outage (normally about 30 seconds).
  15. The Multi-AZ standby is now the primary.

Create a Read Replica

  1. With the database instance still selected, click Actions, and select Create read replica.
  2. For Destination region, select US East (N. Virginia).
  3. Enter a name under DB instance identifier (e.g., "wordpress-rr").
  4. Leave the other defaults, and click Create read replica. It will take a few minutes for it to become available.

Promote the Read Replica and Change the CNAME Records Set in Route 53 to the New Endpoint

  1. Once the read replica is available, check the circle next to it.
  2. Click Actions, and select Promote.
  3. Leave the defaults, and click Continue, and then click Promote Read Replica.
  4. Use the web page to monitor for downtime.
  5. Once the read replica is available, click to open it.
  6. In the Connectivity & security section, copy the endpoint under Endpoint & port.
  7. Open Route 53 in a new tab.
  8. Click Hosted zones, and select the sysopsdatabase hosted zone.
  9. Click Go to Record Sets.
  10. Click the CNAME row.
  11. Replace what's currently in the Value box with the endpoint you copied.
  12. Click Save Record Set.
  13. Monitor using the web page for downtime.

Conclusion

Congratulations on completing this hands-on lab!