Skip to content
Web Design & Development

How to Get Read Replicas and Scaling Reads Right

Copies of a database that serve read queries, reducing load on the primary database.

Marcus Adeyemi Technical Director 2 min read 18 views
How to Get Read Replicas and Scaling Reads Right

What is at stake

Most web applications read far more than they write, and replicas are a common first scaling step.

The playbook

  1. Route reporting and heavy reads to replicas
  2. Read from the primary after writes when consistency matters
  3. Monitor replication lag
  4. Test failover procedures
  5. Document which queries go where

Where it goes wrong

Avoid:

  • Sending all reads to replicas blindly
  • Ignoring replication lag in user-facing flows
  • Unmonitored replicas
  • Failover never tested
What to do and what to avoid with read replicas and scaling reads, side by side
Good practice against the usual mistakes, from the sources listed below.

The numbers behind it

Published figures for Read Replicas and Scaling Reads
MeasureFigure
Replication lagreplicas can be slightly behind the primary
Read-after-writeusers may not see their own changes on a replica
Routingapplications must decide which queries go where
Failoverreplicas can be promoted during outages

Getting outside help

When to hand it over: Bring in help when database load limits growth.

Where this comes from

The figures and practices above come from the sources listed.

Working on something like this?

We take on Web Design & Development work for teams who want it done once, properly. Tell us what you are building and we will tell you honestly whether we are the right studio for it. Start a project.

Where to go next

Spotted something wrong? Report an error on this page. We correct on the page and say what changed.

All services

The work behind this article, and what it costs.

Marcus Adeyemi

Builds and maintains the web work. Writes about front-end architecture, performance, accessibility and the unglamorous parts of keeping a site alive.

Keep reading

More in Web Design & Development