The fix spectrum
The database remedies, from an hour of work to a permanent commitment
Each stage relieves a different kind of pressure and costs more than the one before it — in work, and in complexity the system keeps paying for. The order exists because skipping ahead buys complexity a cheaper fix would have avoided.
01
Queries and indexes
Read the plans of the slowest queries in production. A scan that should be an index lookup, a join without support, a query fetching columns nothing uses — this is where most bottlenecks actually live.
- Query plans
- Indexes
02
Connection pooling
A database drowning in connection churn slows down regardless of query quality. A pooler in front of it turns thousands of application connections into a handful of steady database ones.
- Pooler
03
Offload the reads
Read replicas and caching layers move read traffic off the primary. Powerful, and no longer free: both serve data that can be moments behind, and the application must be told where that is acceptable.
- Replicas
- Cache
04
Partition, then shard
Splitting data by range or key relieves genuine write and volume limits — and permanently complicates queries, transactions, operations and every future feature. Justified by measured exhaustion of everything above, never by anticipation.
- Partitions
- Shards
The premature shard
Sharding adopted before it is needed is the costliest database mistake we see: the complexity arrives immediately and forever, the benefit was years away, and an index would have solved the original problem.
Stop at the first stage that holds under measurement. The next stage is always still there if the load grows into it.
The trade-off
Replicas and caches sell speed and charge in freshness
A read replica is a copy of the database that lags the original by some small, variable amount. A cache is a remembered answer that may no longer be true. Both take enormous read pressure off the primary, and both introduce the same question in different clothes: is it acceptable, here, to show data that is seconds old? For a product listing, almost always. For an account balance a user is looking at right after paying, almost never. The systems that get into trouble are not the ones that use replicas and caches — it is nearly impossible to scale reads without them — but the ones that adopt them without ever asking that question per screen, and then field bug reports that are actually consistency decisions nobody made.
So we introduce read offloading with the trade-off stated, screen by screen: which reads may be served stale and how stale, which must go to the primary, and how a cache is invalidated when the underlying truth changes. Written down, these are small decisions a product owner can make in an hour. Left implicit, they surface later as the worst kind of bug — intermittent, unreproducible, and correct behaviour according to the system as built.
Choosing a remedy
Tune, offload or split: what each database fix buys and what it costs
Three families of remedy, three different bills. The right one is determined by what the measurement says is scarce — not by which is most impressive in an architecture diagram.
| Option | What it relieves | What it costs, and for how long | The sign it is the right stage | Best for |
|---|---|---|---|---|
| Tune what exists | Queries doing needless work — the cause of most bottlenecks that feel like capacity problems. | Hours to days of analysis; no new moving parts, no new failure modes. | Query plans show scans, missing indexes or queries that grew with the data. | Almost everyone, first |
| Offload the reads | A primary saturated by read traffic while writes remain comfortable. | New infrastructure plus a permanent consistency question the application must answer per screen. | Tuned queries still saturate the primary, and the traffic is mostly reads. | Read-heavy systems at real scale |
| Partition or shard | Genuine write-volume and data-volume limits a single primary cannot hold. | A permanent tax on queries, transactions, operations and every future feature — paid from day one, forever. | The cheaper stages are measurably exhausted and writes themselves are the ceiling. | The few who have truly outgrown one primary |
Our role
What we measure in the database and what we refuse to build early
- 01
The plans read first
We start with the production query plans and the slowest operations, because that is where most bottlenecks resolve — and it is the only starting point that costs nothing if we are wrong.
- 02
Trade-offs put in writing
Where pooling, replicas or caching are warranted, we implement them with the consistency decisions documented per read path, so staleness is a choice your product made rather than a bug it inherited.
- 03
The expensive step, gated
We will recommend partitioning or sharding when the measurements justify it, and we will say plainly when they do not — including when the honest advice is that the drastic step is years away.
How much staleness each screen tolerates is a product decision we help you frame; the engineering commitment we make is that every remedy is justified by a measurement, and no complexity is added ahead of the load that demands it.
Common questions
What buyers ask
Is sharding the answer when the database becomes the bottleneck?+
Occasionally, eventually, and almost never first. Sharding solves one specific problem — write and data volumes a single primary genuinely cannot hold — and charges for it permanently: queries that cross shards become hard, transactions across them become harder, operations multiply, and every future feature pays the tax. Most database bottlenecks are not that problem. They are a missing index, a query that grew pathological with the data, connection churn, or read pressure a replica or cache would absorb. The measurement tells you which you have: if the slowest queries are doing needless work, you are at the cheap end of the spectrum, and sharding would have bought you the complexity without needing the capacity.
Do read replicas help when the writes are what is slow?+
Not directly — a replica accepts no writes, so it cannot share the write load. What it does is take read traffic off the primary, and that indirectly helps writes when reads and writes were competing for the same resources, which is common. But if the writes themselves are the ceiling — heavy ingestion, hot rows under contention, transactions queueing on locks — the remedies are different: write-path tuning, batching, restructuring the hot data, and, at genuine scale, partitioning. This distinction is exactly why the diagnosis has to precede the architecture: replicas added against a write bottleneck add cost and a consistency question while the actual problem continues untouched.
How do we know the database is the bottleneck and not the application?+
By tracing a request end to end and seeing where the time actually goes, because the symptom is identical either way — pages load slowly, timeouts fire, everyone points at the database because that is where slowness traditionally lives. A trace splits each request into its application time and its database time. If the database portion dominates, the query plans say why. But a substantial share of "database problems" turn out to be application patterns that generate absurd query loads — the N+1 pattern issuing hundreds of small queries per page, missing application-side caching, connections opened per request. In those cases the database is executing everything quickly and is simply being asked to do far too much, and the fix belongs in the application. Tuning the database against an application problem improves the wrong layer.
In this cluster
Diagnose it with us
A database review that reads your production query plans and names where on the fix spectrum your bottleneck actually falls — and whether the drastic remedies are years away or genuinely due.
Start the conversation
