Scrivio Interview library
ScenarioFoundations6 min read · updated 12 November 2026

Your cloud database bill doubled in three months. List the first things you would check.

First we find which part of the bill grew, using cost allocation tags per team and service. Then we check the usual causes: more or larger instances, including forgotten replicas, test databases and old snapshots; storage growth, provisioned IOPS and backup retention; data transfer across zones or regions; and I/O charges on engines that bill per request, such as Aurora's standard storage, often driven by inefficient queries.

Why this question is asked

A database bill that doubles in three months is rarely caused by one dramatic event. It is usually a few quiet changes adding up: a replica created for a test and never removed, a retention setting raised during an incident, a new service in another zone. Interviewers ask this to see whether we investigate a bill methodically, starting from data rather than guesses, and whether we know where cloud database costs hide. In this answer, we will start with attributing the increase, then check instances, storage and backups, data transfer, and per-request I/O charges, and finish with how to keep it from happening silently again.

1Attribute the Increase Before Guessing

The cloud bill is made of line items: instance hours, storage, IOPS, backup storage, data transfer, I/O requests. The first step is to open the provider's cost explorer and break the database spend down by those line items and by month, so we can see which ones grew. A bill that doubled because instance hours doubled is a very different problem from one where data transfer went from almost nothing to a third of the total.

Cost allocation tags, labels like team, service and environment attached to every resource, let us go one level further: which team's or service's databases grew. If tags are missing, that is the first finding, and we fix it, because without attribution every future increase will need the same detective work. A resource with no tag often turns out to be exactly the forgotten one we are looking for.

Step throughWorking through a doubled bill
  1. Break down spend by line item and monthinstances, storage, IOPS, backups, transfer, I/O
  2. Break down by tagsteam, service, environment
  3. Did instance hours grow?count and size
    YesLook for new, larger or forgotten instancesNoNext line item
  4. Did storage or backups grow?GB, IOPS, retention
    YesCheck growth, IOPS settings, snapshotsNoNext line item
  5. Did data transfer or I/O grow?cross-zone, per-request
    YesFind chatty services and heavy queriesNoLook at pricing changes

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

2Instances: Size, Count and the Forgotten Ones

Instance hours are usually the largest line item, so we list every database instance with its class, its tags and its creation date. We compare with three months ago. The common findings are instances scaled up during an incident and never scaled back, read replicas created for a migration or a report that nobody uses anymore, staging and test databases running around the clock at production size, and databases for services that were retired.

For each instance we look at utilisation over the last few weeks. A replica with close to zero connections, or a test database with no queries since last month, is a candidate for removal after checking with its owner. We also check snapshots: manual snapshots are kept until someone deletes them, and a habit of taking one before every deployment can leave hundreds of them.

Java
# AWS CLI example: list RDS instances with class and creation time
aws rds describe-db-instances \
--query 'DBInstances[].[DBInstanceIdentifier,DBInstanceClass,InstanceCreateTime]' \
--output table
# | orders-prod | db.r6g.2xlarge | 2024-03-11 |
# | orders-prod-replica2 | db.r6g.2xlarge | 2026-08-20 | <- created for a migration?
# | perf-test-copy | db.r6g.4xlarge | 2026-09-02 | <- no connections for 6 weeks
aws rds describe-db-snapshots --snapshot-type manual --query 'length(DBSnapshots)'
# 412

3Storage, IOPS and Backup Retention

Storage costs grow with data, but also with settings. On many services, allocated storage can grow automatically and never shrinks back, so a one-off bulk load or a bloated table can permanently raise the bill. Provisioned IOPS, a guaranteed rate of disk operations that we pay for whether we use it or not, is often raised during a performance problem and left there. Newer volume types can give the same performance for less, so it is worth checking whether older volume types are still in use.

Backup storage is the other quiet one. Automated backups beyond the free allowance, longer retention periods set after an audit, and copies to another region all add up. We check whether the retention matches a real requirement, and whether old manual snapshots are still needed.

4Data Transfer Across Zones and Regions

Traffic between availability zones and between regions is billed, while traffic inside one zone usually is not. This line item often appears suddenly: a new service is deployed in a different zone from its database and reads a lot of data, a read replica is placed in another region for disaster recovery, or a data export job copies tables to a bucket in another region every night.

We look at transfer costs by resource and find the largest flows. A reporting service in zone B reading 2 TB a day from a primary in zone A can cost more per month than the database instance itself. Moving the service, reading from a replica in its own zone, or reducing what it reads usually fixes it.

5Per-Request I/O Charges and Inefficient Queries

Some engines bill for I/O requests rather than only for provisioned capacity. Aurora's standard storage configuration charges per million read and write I/Os, and a query that does a sequential scan on a large table every few seconds can generate billions of I/Os a month. A newly deployed feature with a missing index can therefore show up first on the bill, not in latency.

So we connect cost to queries. pg_stat_statements or the provider's query insight tool shows the queries with the most blocks read; a sudden newcomer at the top is the likely culprit. Fixing the query or adding the index reduces both the I/O bill and the CPU load. For workloads with consistently high I/O, Aurora's I/O-Optimized configuration, which charges more for compute and storage but nothing per I/O, can be cheaper; the provider's guidance and our own numbers decide (check current pricing).

SQL
SELECT left(query, 50) AS query, calls,
shared_blks_read + shared_blks_hit AS blocks_touched
FROM pg_stat_statements
ORDER BY shared_blks_read DESC
LIMIT 3;
-- SELECT * FROM events WHERE account_id = $1 | 86400 | 912345678 <- new in September, no index

6Follow-up questions

How do you stop this from happening again?

We set budgets and anomaly alerts on database spend per team, require tags at creation time through the provisioning pipeline, and review a monthly cost report per service. Non-production databases get schedules or expiry dates when they are created.

Is it safe to delete an idle replica?

Only after checking that nothing depends on it: connection strings in configuration, disaster recovery plans and scheduled jobs. We contact the owner, take a final snapshot if needed, and then remove it.

Could the provider's price have changed?

It can, for example when extended support charges begin for an old engine version. That is why we compare unit prices month to month as well as usage; running an end-of-support version can add a noticeable per-hour charge.

7Conclusion

In this answer, we investigated a doubled database bill by first attributing it with line items and cost allocation tags, then checking instance size and count including forgotten replicas, test databases and snapshots, storage growth, provisioned IOPS and backup retention, data transfer across zones and regions, and per-request I/O charges driven by inefficient queries. Each finding points to a clear, low-risk fix.

What to say in the interviewAbout 80 seconds aloud

Open with

I would start with data, not guesses. In the cost explorer I would break the database spend down by line item and month, instance hours, storage, IOPS, backup storage, data transfer and I/O requests, to see which ones grew, and then by cost allocation tags to see which teams and services.

Then, if they want more

Missing tags are a finding in themselves. Then I would check the usual suspects. Instances: anything scaled up during an incident and never scaled back, read replicas nobody uses, test and staging databases running all day at production size, and hundreds of manual snapshots.

Storage: automatic growth that never shrinks, provisioned IOPS raised and left high, older volume types, and backup retention or cross-region copies. Data transfer: services in a different zone or region from their database reading a lot of data.

And I/O charges on engines that bill per request, like Aurora standard storage, where a new query without an index can cost a lot; I would look at pg_stat_statements for queries with the most blocks read. After fixing what I find, I would add budgets, anomaly alerts and mandatory tags so the next increase is visible within days.

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.
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 cloud database bill doubled in three months. List the first things you would check.": https://scrivio-interview-library.netlify.app/databases/database-operations/9c0b36915b/