Concept
Read replicas
Copies of a database that serve reads. They add read capacity, not high availability.
Goal
- Read replica
- More read capacity
- Multi-AZ
- High availability
- Cache
- Faster repeated reads
Copy is
- Read replica
- Asynchronous
- Multi-AZ
- Synchronous
- Cache
- A copy of hot data
Serves reads
- Read replica
- Yes
- Multi-AZ
- Standby: no for a Multi-AZ DB instance. A Multi-AZ DB cluster has two standbys you can read from.
- Cache
- Yes
Failover
- Read replica
- Manual promotion
- Multi-AZ
- Automatic
- Cache
- None
Other Region
- Read replica
- Yes
- Multi-AZ
- No
- Cache
- Not by itself
| Compare | Read replica | Multi-AZ | Cache |
|---|---|---|---|
| Goal | More read capacity | High availability | Faster repeated reads |
| Copy is | Asynchronous | Synchronous | A copy of hot data |
| Serves reads | Yes | Standby: no for a Multi-AZ DB instance. A Multi-AZ DB cluster has two standbys you can read from. | Yes |
| Failover | Manual promotion | Automatic | None |
| Other Region | Yes | No | Not by itself |
1 / 3
Goal
- Read replica
- More read capacity
- Multi-AZ
- High availability
- Cache
- Faster repeated reads
Copy is
- Read replica
- Asynchronous
- Multi-AZ
- Synchronous
- Cache
- A copy of hot data
| Compare | Read replica | Multi-AZ | Cache |
|---|---|---|---|
| Goal | More read capacity | High availability | Faster repeated reads |
| Copy is | Asynchronous | Synchronous | A copy of hot data |
2 / 3
Serves reads
- Read replica
- Yes
- Multi-AZ
- Standby: no for a Multi-AZ DB instance. A Multi-AZ DB cluster has two standbys you can read from.
- Cache
- Yes
Failover
- Read replica
- Manual promotion
- Multi-AZ
- Automatic
- Cache
- None
| Compare | Read replica | Multi-AZ | Cache |
|---|---|---|---|
| Serves reads | Yes | Standby: no for a Multi-AZ DB instance. A Multi-AZ DB cluster has two standbys you can read from. | Yes |
| Failover | Manual promotion | Automatic | None |
3 / 3
Other Region
- Read replica
- Yes
- Multi-AZ
- No
- Cache
- Not by itself
| Compare | Read replica | Multi-AZ | Cache |
|---|---|---|---|
| Other Region | Yes | No | Not by itself |
What it is
A read replica is a read-only copy of an RDS database. The primary sends its changes to the replica asynchronously, so a replica can lag a little behind. You create replicas yourself, and RDS does not add or remove them for you. For MySQL, MariaDB and PostgreSQL you can have up to 15 per source. The replica can be in the same Region or in another Region.
Use replicas when reads are the bottleneck: reporting queries, a read-heavy website, or a read-only copy near users in another Region. The application must send its reads to the replica endpoint. Each replica has its own endpoint, so the application or a library has to split reads from writes.
What it is
A replica is not a high availability feature. Failover to a replica is manual: you promote it to a standalone database, and then point the application at it. For automatic failover, use Multi-AZ. A cross-Region replica is also a simple way to prepare for disaster recovery.
Remember
- Asynchronous replication. Reads can return slightly old data.
- Up to 15 replicas for MySQL, MariaDB and PostgreSQL. Cross-Region replicas are allowed.
- Each replica has its own endpoint. The application chooses where to send reads.
- Promote a replica to make it a standalone database. This is a manual step.
Remember
- Replicas cost the same as a normal instance. Automated backups must be on in the source.
- Aurora has its own replicas, up to 15, with a shared storage volume.
On the exam
- “Reporting queries slow down the production database” points to a read replica.
- “Automatic failover” points to Multi-AZ, not a read replica.
- “Read-only copy of the database in another Region for local reads or disaster recovery” points to a cross-Region read replica.
- “Same read load, but microsecond latency or repeated identical queries” points to a cache such as ElastiCache.
Do not mix it up with
- Regions and AZs as the HA building blockWhich services are Region-wide and which belong to one AZ, and how to spread tiers so that one AZ can fail.
Amazon ElastiCacheIn-memory cache. Choose Valkey or Redis OSS for rich features, Memcached for a simple multithreaded cache.
Amazon AuroraA cloud-built MySQL- and PostgreSQL-compatible database with shared storage, fast failover and up to 15 replicas.