A read replica is a copy of a primary database that serves read operations while the primary handles writes. It addresses a scalability problem: when queries are already optimized but read volume overwhelms one database server, replicas distribute that traffic across multiple servers and increase read capacity without changing the primary’s configuration. section 5.4.2 section 5.5.1 section 5.1
Replication creates a consistency trade-off. Replication lag is the delay before a write on the primary appears on a replica. Synchronous replication waits for replica confirmation, reducing lag but adding latency to every write; asynchronous replication improves write performance but can leave replicas behind by milliseconds or seconds under heavy load. A replica is therefore appropriate only when the read can tolerate the chosen consistency behavior. section 5.4.2
Use read replicas as a measured scaling pattern:
- First establish that the bottleneck is scalability under growing load, rather than slow individual queries or a resilience failure. section 5.1
- Offload read traffic only after query optimization when volume, not inefficient queries, is the limiting factor. section 5.5.1
- Keep writes on the primary and identify read-after-write flows that would confuse users if they observe stale data. section 5.4.2
- Choose deliberately between lower-lag synchronous replication and faster asynchronous writes with eventual consistency. section 5.4.2
- Treat replicas as one database-layer option alongside materialized views, denormalization, connection pooling, indexing, and sharding decisions driven by actual bottlenecks. section 5.5.1 section 5.6
Profile update and stale read
A user updates a profile, then immediately views it. If that follow-up read reaches a replica that has not received the write, the old profile can appear and make the update seem to have vanished. This is a lag-sensitive path: increasing read capacity alone is not enough; routing and consistency behavior must preserve the user-visible result. section 5.4.2
Scaling a read-heavy primary
A single-primary PostgreSQL deployment can serve a very large read-heavy workload with nearly 50 replicas across regions. The approach scales reads horizontally while separately controlling write pressure through connection pooling, workload isolation, and separate sharded databases for new write-heavy features. Sharding follows demonstrated write bottlenecks rather than user count alone. section 5.4.2
Read replicas do not make every database problem a replication problem. They add infrastructure and cannot fix a speed problem caused by poor algorithms or unoptimized queries. They are most useful when the user-facing goal is to keep read paths responsive as demand grows, while making staleness an explicit operational and product decision. section 5.4.2 section 5.1


