032 · REPLICA · RDS · READ SCALING

Read Replicas

Offload read traffic to synchronized copies of the primary database.

If you are new here: A read replica is a read-only copy of your database that follows the primary by replaying its log of changes. You send writes to one leader; you spread reads across replicas — with lag as the trade-off.

Traffic typeUsually routed to
INSERT / UPDATE / DELETEPrimary
Heavy reporting, fan-out readsReplicas
“Just wrote, must read back”Primary (or app-level rule)
TermPlain meaning
Primary / leaderThe writable database that accepts INSERT/UPDATE/DELETE
Replica / standbyA read-only copy that follows the leader’s change log
Replication lagHow far behind a replica is — stale reads are normal
Read-after-writeUser flow where the next read must see the just-written row

The Problem

Your single primary serves every transaction and every report. Transactional (OLTP) traffic and heavy SELECT analytics fight for the same CPU and connections. Checkout queries and nightly BI exports share one connection pool; a slow report can still block resources the payment path needs.

In plain terms: read replicas are photocopies of your database that can answer SELECT — so the writer stops being the only place every read goes.

Analogy: A busy store with one cashier for returns and catalog questions turns into chaos. Replicas are extra staff who can answer questions (reads) but cannot change inventory (writes) — unless you promote one, which is a different (risky) story.

Read replicas add read-only copies fed by the replication log — trading operational complexity and eventual reads for horizontal read capacity.

That is the problem this lesson exists to solve: scale reads and protect the primary without pretending replicas are magic extra writers.

When the primary becomes the bottleneck

Add replicas

The primary applies commits; standbys replay the write-ahead log (WAL — the database's sequential record of every change, like a redo journal) asynchronously. They are not extra primaries — writes still funnel to one leader (in the usual pattern).

Analogy: The primary is the authoritative textbook; replicas are photocopies that get new pages faxed over — usually fast, but not instant.

Split read and write paths

Applications or proxies route INSERT/UPDATE/DELETE to the leader and balance SELECT across replicas — often with health and lag awareness.

Pseudo-config idea: “Reporting service uses replica.internal; checkout service uses primary.internal for payment rows.”

Replication lag

Replicas trail the primary. A few milliseconds is normal; spikes happen under load or network issues — monitor replication lag like an SLO.

Stale reads humans notice

After I post a comment, my next GET might hit a replica that has not applied that write yet — looks like data loss. Mitigations: read-after-write to primary, session stickiness, or client hints.

PatternMitigation
User creates resource, immediately listsRoute that read to primary briefly
Global analytics dashboardReplicas OK; label “~1 min delay”

Trade-offs

Why this matters for you

Replicas are cheap read scale and great for reporting — but correctness-sensitive flows need a plan for your writes, your reads until BASE semantics are acceptable.

Next: Data Replication covers the mechanics — synchronous vs asynchronous replication and what multi-leader setups mean for conflict resolution.

DIAGRAMDrag nodes · pan · pinch or double-click to zoom
FRAME 1 OF 7

A single primary is simple — until reporting, exports, and product growth make reads compete with writes.