A typical use
A reporting page that sums a month of trips runs for ten seconds and slows down order entry on the same database. Pointing that report at a read replica removes the contention without changing the data.
Things to plan for
- Lag: a replica may be seconds behind, so a user who just saved a record might not see it if the next page reads from the replica. Route those reads to the primary.
- Routing: the application, a proxy or the framework must know which connection to use for which query.
- Cost: each replica is another server to pay for and monitor.
- Failover: a replica can often be promoted if the primary dies, but check how your platform handles it.
Managed services such as Amazon RDS, Google Cloud SQL and Azure Database make adding a replica a few clicks. Fix slow queries before adding hardware, since a poorly indexed query is slow on every copy.
Questions, answered
No. Writes go to the primary and flow to the replica afterward.
Start with one for reporting or failover and add more only when monitoring shows read load still hurting.