How it works
How much one relational database can handle depends on your schema, query mix, data size, and hardware, so someone else’s figure tells you little. Get your own: load production-sized data into a copy, replay a realistic mix of reads and writes, and raise the rate until p95 latency (the time 95% of requests finish within) climbs sharply.
As an illustrative example, not a general claim, say your app peaks at 25 requests per second with 8 queries each: 200 queries per second. Your benchmark holds its latency target up to 4,000 queries per second, 20 times that peak, so throughput gives no case for a second database yet. One bad pattern can spend that margin: a list page that runs one extra query per row (an N+1 pattern) turns one request for 100 rows into 101 queries.
What breaks first is often something specific rather than total capacity. A missing index forces a scan that slows as the table grows. Connections run out: Postgres gives each connection its own process, so many idle app connections can reach its limit, which a pooler such as PgBouncer eases. A long transaction or schema migration holds locks that make other queries wait. Data can outgrow memory, pushing reads to disk.
Reads that stay slow across many queries after tuning argue for a read replica, if you can accept replication lag. Writes that saturate the primary after tuning and a larger machine argue for splitting data across databases, such as sharding, because replicas do not take writes away from the primary.
Your SaaS runs on one Postgres instance. Dashboard p95 has climbed from 200 ms to 3 seconds over six months, CPU sits near 85% during the workday, and pg_stat_statements shows a single query taking 60% of total database time. A teammate proposes a read replica and Redis. What do you do first, and what would change your mind?
Run EXPLAIN on that query and fix it with an index or a rewrite, then re-measure, since a replica would only run the same slow query on a second machine. Reconsider if CPU still saturates on many different reads after tuning (then a replica, accepting lag), or if writes are what saturate the machine (then a larger machine, and after that splitting the data).
Use this as a guide for self review; written answers are not graded.Keep in mind
- Benchmark your own query mix on production-sized data; borrowed numbers do not transfer.
- Look first for missing indexes, connection limits, locks, and memory pressure.
- Saturated writes after tuning and a bigger machine are real evidence for splitting data.