pattern

Read Replica

A copy of a database that receives changes from the primary and serves read-only queries, spreading read load.

scalingreplicationdatabases

The first and cheapest scaling move for a read-heavy workload, and the one to exhaust before sharding. Replicas also give a warm standby for failover and a place to run analytical queries without competing with production traffic.

The thing to design around is replication lag. A read served from a replica may be milliseconds or minutes behind, and a user who writes and then immediately reads will see the old value. The standard remedy is to route reads that follow a write from the same session to the primary for a short window, rather than trying to eliminate lag.

Replicas do not help write throughput at all — every write still goes to one primary and is applied on every replica. If writes are the bottleneck, replicas make it slightly worse.