Single database vs read replicas
One database serves every read and write. Read replicas copy the data and serve the reads, so the primary keeps its CPU for writes. At 10,000 reads/s and 1,000 writes/s, one database gives p99 4,160 ms. A replica set gives p99 24.8 ms for 16 USD/mo more.
Quorum 2 of 3 · commit 9.0 ms
280 req/s · CPU 70% · mean 22 ms
Case 1
11,000 requests/s, of which 10,000 are reads. p99 must stay below 100 ms and replica lag below 1 s.
| Measure | Goal | One database | Primary with read replicas |
|---|---|---|---|
| p99 latency | under 100 ms | 4.2 s Fail | 25 ms Pass |
| Replica lag | under 1 s | 0 s Pass | 0.1 s Pass |
| Monthly cost | 8 USD/mo | 24 USD/mo | |
| Error rate | 3.8% | 0% |
Case 2
The same database at 2,000 requests/s. Both layouts give p99 24.8 ms, and one database costs 16 USD/mo less.
| Measure | Goal | One database | Primary with read replicas |
|---|---|---|---|
| p99 latency | under 100 ms | 25 ms Pass | 25 ms Pass |
| Replica lag | under 1 s | 0 s Pass | 0.1 s Pass |
| Monthly cost | 8 USD/mo | 24 USD/mo | |
| Error rate | 0% | 0% |