Scrivio Interview library
DesignPrincipal7 min read · updated 12 November 2026

Your database estate has grown to 400 databases with no shared view of capacity, connection budgets or cost. What long-term capacity management approach would you set?

I would start with an inventory of all 400 databases with an owner, size, connection limit, utilisation and cost for each, because nothing can be managed until it is visible. Then each service gets a connection and capacity budget reviewed against growth forecasts, pool configuration and metrics are standardised through the platform starter, small underused databases are consolidated and hot shared ones split by ownership, and capacity is reviewed regularly by finance and engineering together.

Why this question is asked

Database estates grow one reasonable decision at a time: a new service gets its own database, a team copies an old one for a test that becomes permanent, a migration leaves the old instance running. After a few years nobody can answer simple questions like which databases are nearly full, who pays for them, or what happens to connection limits if traffic doubles. Interviewers ask this design question at principal level because the answer is a system of ownership, data and regular decisions, not a single tool. In this answer, we will recap what capacity management means for databases, then build the approach in order: the inventory, budgets with forecasts, standard configuration through the platform starter, reshaping the estate, and the review rhythm that keeps it healthy.

1What Capacity Management Means Here

Capacity management is the habit of knowing, for every shared resource, how much we have, how much we use, how fast use is growing and what it costs, so we can act before something runs out. For databases the resources are storage, compute, connections and I/O. Each one has a limit: a disk size, a CPU count, a max_connections setting, a provisioned I/O rate. Running out of any of them causes an outage, and over-provisioning all of them wastes money.

With 400 databases, nobody can track this by hand. We need data collected automatically, owners who are responsible for decisions, and a regular meeting where those decisions are made. The rest of the approach builds those three things.

2Step One: Build the Inventory

Everything starts with a list of every database and a few facts about each. The list is built automatically from the cloud provider's APIs and the database engines themselves, not from a spreadsheet people fill in, because a manual list is out of date the week after it is made. Each database must have an owning team; a database with no owner is flagged and goes to a short triage list, where it is either claimed or scheduled for removal.

The inventory joins technical data with cost. Cloud billing tags, or a mapping from instance to team, give the monthly cost of each database, so we can see that, for example, 60 databases use under 5 percent of their CPU while costing 30 percent of the bill.

One row of the database inventory
FieldExampleUsed for
Database and engineorders-prod, PostgreSQL 17Upgrade planning, support dates
OwnerCheckout teamWho decides and who pays
Size and growth420 GB, +12 GB per monthStorage forecast
Connections: limit and peak200 limit, 150 peakConnection budget and risk
CPU and I/O utilisationp95 CPU 35 percentRight-sizing and consolidation
Monthly cost2,100 dollarsCost per service, finance review
Consumersorders-service, reporting-jobsWho is affected by changes
Collected automatically; a database with no owner goes to triage.

Notice that the inventory is useful from the first week. Sorting by utilisation finds waste, sorting by connection usage finds risk, and sorting by owner shows which teams carry most of the estate.

3Step Two: Give Every Service a Budget and a Forecast

Once usage is visible, each service gets a budget: how many connections it may open in total across all instances, how much storage and compute it is expected to use, and what that costs. The budget is not a punishment; it is a shared plan. The database owner can then see whether all budgets fit inside the database's limits, and the service team can see when growth will hit them.

Budgets come with forecasts. If orders-prod grows 12 GB per month and has 1 TB of storage, it reaches 80 percent in about 32 months, which is plenty of warning. If connection peaks grew from 100 to 150 in a year and the limit is 200, the next year needs a decision now. A simple linear forecast from six months of data is enough to start; we can refine it with the business's own traffic plans for launches and seasons.

SQL
-- PostgreSQL: connections in use per application, compared with the budget
SELECT application_name, count(*) AS connections
FROM pg_stat_activity
WHERE backend_type = 'client backend'
GROUP BY application_name
ORDER BY connections DESC;
-- orders-service | 58 (budget 60: close to the limit)
-- billing-service | 21 (budget 40)

This query only works if every service sets its application name on its connections, which leads straight to the next step.

4Step Three: Standardise Through the Platform Starter

Four hundred databases usually means a few hundred services configured in slightly different ways. Some set the application name, some do not; some publish pool metrics, some use a different metric name; pool sizes range from 5 to 200 with no reasoning. We fix this through the platform's Spring Boot starter, the shared library every service already depends on.

The starter sets sensible HikariCP defaults, such as a small fixed pool, a short connectionTimeout and maxLifetime below any proxy timeout, sets the JDBC application name from spring.application.name, and publishes pool metrics with standard tags for service and database. Teams can still override values, but an override is visible in configuration review. With every service reporting the same metrics, one dashboard shows the whole estate, and the budgets in step two can be checked automatically every day.

5Step Four: Reshape the Estate

The inventory always shows two kinds of problem. The first is many small, underused databases: each one has its own instance, backups, monitoring and upgrade work, even if it holds 2 GB and uses 1 percent of a CPU. Consolidating them, for example as separate databases or schemas on a shared instance per domain, cuts cost and upgrade effort, while keeping logical separation and ownership.

The second is a few hot shared databases that many teams depend on. They are the opposite problem: one team's migration or slow query affects everyone, and the connection budget is contested. Splitting them by ownership, moving each domain's tables to a database its owning team controls, removes the contention. Both changes are planned work, prioritised by cost and risk from the inventory, not a big-bang project.

Step throughDeciding what to do with each database
  1. Read inventory rowowner, utilisation, growth, cost
  2. Does it have an owner?
    YesContinueNoTriage: claim it or schedule removal
  3. Under 10 percent utilisation and small?
    YesCandidate to consolidate onto a shared instanceNoContinue
  4. Shared by several teams and near limits?
    YesPlan a split by ownershipNoKeep, review budget and forecast

4 steps in order. Play them, or step through them one at a time.

The thresholds are examples; each estate sets its own.

6Step Five: Review Regularly, With Finance in the Room

Capacity is a business question as much as a technical one, so the review includes both engineering and finance. A monthly or quarterly review looks at the same few views each time: databases forecast to hit a limit in the next two quarters, the largest cost increases, budgets close to their limits, and progress on consolidation and splits. Finance brings the business forecast and the cost targets; engineering brings the technical risk and the options.

The review produces decisions with owners and dates: resize this instance, move these tables, approve this budget increase, retire these five databases. Over a year, the result is an estate where every database has an owner, every limit has a forecast, and cost per service is known, which is exactly what was missing at 400 databases.

7Follow-up questions

How long would this take to set up?

The inventory and ownership can be in place in a few weeks, because they are mostly automation over existing APIs. Budgets and the standard starter settings take a quarter or two to roll out across teams. Consolidation and splits are an ongoing programme over a year or more, done in order of cost and risk. The important part is that the inventory gives value immediately, so the programme earns support early.

What do you do with a database nobody claims?

We look at its connections and queries over a few weeks. If nothing connects, we take a final backup, stop it, wait a short agreed period, and then delete it, keeping the backup for the retention period. If something does connect, the application name or source address tells us who to ask, and that team becomes the owner.

Why not let each team manage its own databases fully?

Teams should own their databases, but some things only work across the estate: the total cost, shared instance limits, engine upgrade deadlines and standard metrics. Ownership with a shared inventory and review gives both: teams decide about their own databases, and the organisation can still see and plan the whole.

8Conclusion

In this answer, we built a capacity management approach for a large database estate. It starts with an automatic inventory that records owner, size, connections, utilisation and cost for each database. Services then get connection and capacity budgets with growth forecasts, the platform starter standardises pool settings, application names and metrics so the whole estate can be measured the same way, underused databases are consolidated and hot shared ones split by ownership, and a regular review with engineering and finance turns the data into decisions with owners and dates.

What to say in the interviewAbout 80 seconds aloud

Open with

With 400 databases and no shared view, the first thing I would build is an automatic inventory: every database with its owner, engine and version, size and growth rate, connection limit and peak usage, CPU and I/O utilisation, and monthly cost.

Then, if they want more

Any database without an owner goes to triage, to be claimed or retired. Then I would give each service a connection and capacity budget, and attach simple forecasts, for example storage growth per month against the disk size, so we see limits coming quarters ahead.

To measure all of that the same way, I would standardise pool configuration and metrics through our platform Spring Boot starter: sensible HikariCP defaults, the application name set on every connection, and pool metrics with standard tags, so one dashboard covers the estate and budgets can be checked automatically.

Next I would reshape the estate in order of cost and risk: consolidate small, underused databases onto shared instances per domain, and split hot shared databases by ownership so one team cannot hurt another.

Finally I would run a regular capacity review with engineering and finance together, looking at forecasts, cost changes and budgets, and leave each meeting with decisions that have owners and dates.

About this answer

Last updated
12 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Official documentation
java.sql, package documentation
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "Your database estate has grown to 400 databases with no shared view of capacity...": https://scrivio-interview-library.netlify.app/databases/jdbc/f756c319f6/