Skip to content

Read Replicas

One-Liner

Read replicas improve read scalability at the cost of freshness.

What It Is

A database setup where writes go to a primary node and reads are served from replicas that asynchronously replicate data.

Why It Exists

  • Scale read throughput
  • Isolate workloads

How It Works

Writes propagate asynchronously from primary to replicas.

Tradeoffs

Pros

  • Horizontal read scaling
  • Lower load on primary

Cons

  • Replication lag
  • Inconsistent reads

Failure Modes

  • Serving stale reads after writes
  • Replica lag during spikes
  • Misrouting critical reads

Interview Traps

  • Assuming replicas are up-to-date
  • Using replicas for read-after-write flows

Real-World Usage

Common for analytics, timelines, and eventually consistent reads.

Anti-Patterns

  • Strong consistency assumptions
  • Hiding lag from application logic
  • Consistency models
  • Read-your-writes