Database contention: diagnose before scaling

Imagine several applications sharing a database. During a peak period, requests slow down, connections time out and the operations team is trying to determine what has changed.

The instinct might be to scale the database. But what if the main problem is connection pressure rather than compute capacity?

Understand the bottleneck

High CPU utilisation is a symptom, not a root cause. Expensive queries, inefficient execution plans, excessive concurrency, locks, I/O pressure and connection churn can produce different failure modes. Examine application errors, database load and wait events, query performance, connection counts and resource metrics together.

Scaling may help when capacity is genuinely constrained. If the issue is how applications open and hold connections, more compute alone may not fix it.

Where RDS Proxy fits

Before and after: direct connections versus connection pooling

For supported RDS databases, applications can use an RDS Proxy endpoint instead of directly connecting to the database endpoint. The proxy manages a pool of backend connections and can reuse them across client transactions when the session state permits it.

This can be particularly useful when applications create many short-lived connections or experience bursts of demand. It does not distribute connection strings or guarantee that stale application connections disappear. Applications still need sensible timeout, retry and connection-pool settings.

Trade-offs and validation

The leadership takeaway

During an incident, the useful question is not simply “Should we scale?” It is “Which resource is constrained, what evidence supports that conclusion, and which intervention addresses it?”

RDS Proxy is one option to evaluate when connection management is the bottleneck. Good engineering starts with diagnosis rather than a predetermined solution.

References