Read replica
RDS read replicas / Aurora Replicas
An asynchronous copy of the primary database that serves read queries.
In a monolith
Rarely needed early
A monolith with modest traffic reads from the primary. Replicas appear when reads dominate the database’s work.
In a distributed system
Read scaling + reporting
Read-heavy services query replicas; analytics run on a replica so they can’t slow down production writes.
On AWS
RDS read replicas / Aurora Replicas
Asynchronous replicas (RDS) or replicas on Aurora’s shared storage with typically low lag; Aurora’s reader endpoint balances reads.
- RDS read replica$$Async replication; can be cross-region
- Aurora Replica (reader endpoint)$$Low lag, load-balanced, promotable on failover
- Reach for it when
- The primary is busy mostly with reads, and those reads can tolerate slightly stale data.
- What it costs you
- Replication lag: users may not see their own write (read-your-writes)
- Does nothing for writes
- More instances to pay for
- When it dies
- Reads fail over to other replicas or the primary. Promoting a replica after the primary dies can lose the last async writes.
Interview follow-ups
How do you handle read-your-own-writes with replicas?
Send a user’s reads to the primary for a short window after they write, read their own data from the primary, or wait until the replica has caught up to the write.
Can replicas fix a write bottleneck?
No — every write still hits the primary and is replayed on every replica. Writes need batching, sharding or a different store.
Connection rules
It talks to
- Read replicaOnly when: Cascading replication to take load off the primary.
Gets traffic from
Never
- Clients → Read replicaSame as the database: clients get no DB credentials or direct DB access.
- CDN → Read replicaCDN origins are HTTP servers or buckets, never databases or caches.
- Load balancer → Read replicaA load balancer forwards HTTP to compute. Data access needs code: auth, queries, validation.
- API gateway → Read replicaA gateway routes to compute; data access needs your code.
- Queue → Read replicaQueues don’t run code. A consumer reads the message and does the write or call.
- Pub/sub topic → Read replicaTopics don’t run code. A subscriber receives the event and does the write.
- Event stream → Read replicaStreams don’t run code. A consumer reads the records and does the write or call.