0
0
AWScloud~30 mins

Read replicas for performance in AWS - Mini Project: Build & Apply

Choose your learning style9 modes available
Read replicas for performance
📖 Scenario: You manage a database for a popular online store. The main database handles all the writes like adding new orders. But many users also read product details and reviews. To keep the website fast, you want to add read replicas that copy data from the main database. This way, read requests can go to replicas, reducing load on the main database.
🎯 Goal: Create an AWS RDS instance with one read replica to improve read performance. You will first define the main database, then configure a read replica, and finally complete the setup to allow read traffic to the replica.
📋 What You'll Learn
Create a main RDS instance named main-db with MySQL engine version 8.0.28
Create a read replica named read-replica-1 of main-db
Enable public accessibility for both instances
Set the instance class to db.t3.micro for both
Configure the read replica to allow read traffic
💡 Why This Matters
🌍 Real World
Many web applications use read replicas to handle large volumes of read requests without slowing down the main database that handles writes.
💼 Career
Cloud architects and DevOps engineers often configure read replicas to optimize database performance and scalability.
Progress0 / 4 steps
1
Create the main RDS instance
Write AWS CloudFormation YAML code to create an RDS DB instance named MainDB with the identifier main-db. Use the MySQL engine version 8.0.28, instance class db.t3.micro, and set PubliclyAccessible to true.
AWS
Need a hint?

Use AWS::RDS::DBInstance resource type and set the properties exactly as specified.

2
Add the read replica configuration
Add a new resource named ReadReplica1 to create a read replica of MainDB. Set the SourceDBInstanceIdentifier to main-db, use the instance class db.t3.micro, and set PubliclyAccessible to true.
AWS
Need a hint?

Use SourceDBInstanceIdentifier property to link the replica to the main DB.

3
Configure the read replica for read traffic
Add the property DBSubnetGroupName with value default to both MainDB and ReadReplica1 resources to allow network access for read traffic.
AWS
Need a hint?

Adding DBSubnetGroupName helps the instances be reachable in the network.

4
Enable read traffic by setting the appropriate tags
Add a tag with Key set to Purpose and Value set to ReadReplica to the ReadReplica1 resource to indicate its role for read traffic.
AWS
Need a hint?

Tags help identify the role of the resource in AWS.