Read replicas are a form of horizontal scaling: you create one or more copies of your primary database. The replicas stay in sync with the primary and handle read traffic, spreading the load and increasing your capacity for reads.

Failover

When the primary database goes down, a read replica can be promoted to become the new primary. The replica chosen can depend on its lag time, operational status, or configured priority. In AWS RDS, you can create replicas with a few clicks or a single CLI command, and RDS can fail over automatically or manually to a specific replica.

Consistency

Reading from a replica usually gives eventual consistency: there is a small delay (replication lag) between a write on the primary and its appearance on the replica. For many applications this delay is negligible.

For strong consistency, reads must not hit the replica until the write has been replicated. One approach is synchronous replication, where the primary waits for the replica before completing a write. This guarantees consistency but can hurt write performance and availability.

Use cases

  • Read-heavy workloads: distribute reads across multiple databases.
  • Data reporting: run heavy analytics on a replica so the primary is unaffected.
  • Geographic distribution: place replicas near users to reduce latency.
  • Backups: take backups from a replica without loading the primary.
  • Failover support: promote a replica for high availability.

Rule of thumb: consider read replicas for read-heavy systems when caching alone cannot solve the problem.