Read Replicas for Read Scaling
Create Read Replicas to offload read traffic, understand asynchronous replication lag, and promote replicas for DR.
What Are Read Replicas?
Read Replicas are copies of your RDS primary instance that receive updates through asynchronous replication. Unlike the Multi-AZ standby, Read Replicas are accessible for SELECT queries, allowing you to distribute read traffic and reduce the load on the primary database.
Read Replicas are supported for MySQL, PostgreSQL, MariaDB, Oracle (with Active Data Guard), and all Aurora editions. You can have up to 15 Read Replicas for Aurora MySQL and Aurora PostgreSQL, and up to 5 for standard RDS MySQL/PostgreSQL.
Creating a Read Replica
To create a Read Replica, your source instance must have automated backups enabled (retention period greater than 0). AWS takes a snapshot of the primary, restores it in a new DB instance, and establishes asynchronous replication from the primary.
Each Read Replica gets its own DNS endpoint. Your application must be updated to direct reads to the replica endpoints. Connection poolers or application frameworks with read/write splitting can route SELECT queries to replicas automatically.
# Create a Read Replica from the primary
aws rds create-db-instance-read-replica \
--db-instance-identifier mydb-replica-1 \
--source-db-instance-identifier mydb \
--db-instance-class db.t3.mediumAll lessons in this course
- RDS Engines and Instance Classes
- Multi-AZ and Automated Backups
- Read Replicas for Read Scaling
- RDS Security: Encryption and Parameter Groups