What actually bills when a dev database sits idle?
A database bill has several meters, and they don't all pause together. Compute is metered by time: instance-hours for provisioned RDS and Aurora, ACU-hours for Aurora Serverless v2. Storage is metered by capacity: GB-months of allocated volume (RDS) or consumed cluster volume (Aurora). Neither meter cares whether anyone runs a query. Stopping a database halts the time-based compute charge, but your data still exists on disk, so the capacity-based charges continue.
| Cost component | How it's metered | Stops when compute is paused? |
|---|---|---|
| Compute | Instance-hours or ACU-hours | Yes |
| Storage | GB-months (allocated on RDS, used on Aurora) | No |
| Provisioned IOPS/throughput (RDS) | Provisioned amount per month | No |
| I/O requests (Aurora Standard) | Per million requests | Effectively, since no queries run |
| Automated backups and manual snapshots | GB-months beyond the free allowance | No |
| Data transfer | Per GB moved | Effectively, since nothing moves |
Pausing reduces only part of the bill. Backups and snapshots are a common surprise in dev accounts. Manual snapshots stay until someone deletes them. Also, Aurora counts backup storage used within your retention period against a free allowance, but snapshots kept beyond the retention period are billed separately.
Consider a dev database that gets queried a few hours a week but holds a production-sized copy of the data. Compute is the line item teams focus on cutting. Yet a 2 vCPU instance stopped most of the week costs little, while 500 GB of storage plus a stack of old snapshots bills the same every hour of the month. For that profile, solving compute can leave storage and backups as the largest remaining cost.
How does it work? The two mechanisms in brief
The two approaches in this article cut compute cost in different ways.
- Aurora Serverless v2 changes how compute is metered. The cluster has no fixed instance size. Aurora adjusts capacity in ACUs between a minimum and maximum you configure, based on load, and bills for the capacity provisioned over time. With scale to zero, the cluster pauses its compute after a period with no connections and resumes when a new connection arrives. No external scheduler is involved. The database decides when to pause based on activity.
- Stop/start changes whether compute exists. A provisioned RDS instance or Aurora cluster keeps a fixed size while running. You stop it through the API, and compute billing ends until you start it again. Nothing happens automatically, apart from AWS restarting a stopped database after seven days. Something outside the database, such as a scheduled job or a developer, decides when it runs.
In both cases storage, backups, and snapshots keep billing. The sections below cover how each mechanism bills, how it behaves, and where it breaks down.
How does Aurora Serverless v2 billing work, and what does scale to zero change?
Aurora Serverless v2 measures compute in Aurora Capacity Units (ACUs). Each ACU is a bundle of memory with proportional CPU and networking, and capacity adjusts in fractional steps between a minimum and maximum you set on the cluster. You pay for the ACUs actually provisioned, metered per unit of time, plus storage and I/O billed separately. The maximum protects you from runaway load. The minimum decides what an idle database costs.
That floor bills continuously. A cluster configured with a nonzero minimum never drops below it, so a dev database nobody has touched since Friday still accrues the minimum ACUs every hour of the weekend. The per-ACU-hour rate is also higher than the equivalent hourly rate of a small provisioned instance. If your dev workload rarely bursts, a floor of a few ACUs can cost more than a fixed burstable instance that does the same job.
Scale to zero removes the floor. With a minimum of zero and auto-pause enabled, the cluster pauses its compute after a configurable period with no activity, and compute billing stops while storage billing continues. The first connection after a pause wakes the cluster, and that connection waits while capacity comes back. This typically takes seconds, which is long enough to trip short client timeouts. Support depends on engine version and cluster configuration, so check current AWS documentation for your setup before you plan around it.
Pausing requires real inactivity. A monitoring agent polling every minute, a connection pooler holding sessions open, ORM keepalive queries, or a forgotten SQL client on someone's laptop can each keep the cluster above its floor or awake indefinitely.
How does RDS stop instance and Aurora cluster stop work?
Stopping removes that problem entirely, because a stopped database accepts no connections at all.
When you stop an RDS instance or an Aurora cluster, AWS releases the compute, and instance-hour (or ACU) billing ends. Everything that persists keeps billing: allocated storage, Aurora cluster volume storage, automated backup storage beyond the free allocation, and manual snapshots. Endpoints, parameter groups, and security groups are retained, so the database comes back with the same configuration. For a dev database, this means stopping cuts the largest line item but never brings the bill to zero.
AWS caps how long a database stays stopped. After seven days, it starts the database automatically so it can apply required maintenance. Nothing alerts you when this happens, and the database bills as running from that point on. A one-time stop, or a schedule that only issues stops at fixed times, will drift back to full compute charges within a week. Whatever stops the database has to keep checking and re-stop it after an automatic restart.
Not every database can be stopped. Eligibility depends on the engine, the engine version, and the topology. For example, read replicas and instances that have read replicas have restrictions, and some Aurora configurations, such as global databases, cannot be stopped. Check eligibility for each database before you include it in a schedule.
The commands are stable and symmetric:
- RDS instance:
aws rds stop-db-instance --db-instance-identifier <id>andaws rds start-db-instance --db-instance-identifier <id> - Aurora cluster:
aws rds stop-db-cluster --db-cluster-identifier <id>andaws rds start-db-cluster --db-cluster-identifier <id>
For Aurora, you stop the cluster, not its individual instances. Starting a stopped database takes several minutes, so plan for that delay before developers can connect.
#!/usr/bin/env bash
set -euo pipefail
INSTANCE_ID="dev-postgres-01" # standalone RDS instance (placeholder)
CLUSTER_ID="dev-aurora-cluster" # Aurora cluster (placeholder)
status=$(aws rds describe-db-instances \
--db-instance-identifier "$INSTANCE_ID" \
--query 'DBInstances[0].DBInstanceStatus' --output text)
if [ "$status" = "available" ]; then
aws rds stop-db-instance --db-instance-identifier "$INSTANCE_ID"
fi
status=$(aws rds describe-db-clusters \
--db-cluster-identifier "$CLUSTER_ID" \
--query 'DBClusters[0].Status' --output text)
if [ "$status" = "available" ]; then
aws rds stop-db-cluster --db-cluster-identifier "$CLUSTER_ID"
fi
A scheduled bash check that stops an RDS instance and an Aurora cluster only when they are running, so automatic restarts after seven days get caught and reversed.
Which option is cheapest? An illustrative cost estimate
Illustrative estimate (assumed numbers, not a benchmark). These rates are hypothetical. Replace them with current pricing for your region.
- Small provisioned instance: $0.08/hour
- Serverless v2: $0.12 per ACU-hour, averaging 2 ACU while active
- Month: 730 hours. Weekday schedule: 220 hours. Sporadic: 13 hours.
Formulas:
- Provisioned: hours running × hourly rate
- Serverless v2: (active hours × active ACU + idle hours × floor ACU) × ACU rate
- Auto-pause: the Serverless v2 formula with the floor set to 0
| Pattern | Always-on provisioned | Scheduled stop/start | Serverless v2, 0.5 ACU floor | Serverless v2, auto-pause |
|---|---|---|---|---|
| Always on | $58.40 | n/a | $175.20 | $175.20 |
| Weekdays, 10 h/day | $58.40 | $17.60 | $83.40 | $52.80 |
| Sporadic, ~3 h/week | $58.40 | $17.60* | $46.14 | $3.12 |
*Sporadic access can't be predicted, so the database follows the weekday schedule.
Why the results fall this way:
- Steady use: Serverless v2 costs about three times more than provisioned. You pay a premium per unit of capacity, and that premium only pays off when the database is idle.
- Predictable working hours: a schedule removes most idle time at the cheaper provisioned rate, so stop/start wins.
- Sporadic access: auto-pause wins because nothing bills between sessions. Even a 0.5 ACU floor costs roughly as much as running provisioned all month. The trade-off is resume latency on the first connection.
Storage and backups bill whether the database is running, stopped or paused. Assume 100 GB at $0.10/GB-month plus $5 of backup, for $15 per database. In the sporadic case, that fixed $15 is almost five times the $3.12 compute bill.
For development budgets, compute savings scale with how many environments you can pause. Storage scales with how many environments exist. With 20 per-developer databases, the fixed floor is $300/month before any compute. Deleting stale environments often saves more than tuning how idle ones are paused.
Who should use each strategy? Mapping dev databases by access pattern
Start by sorting every non-production database by how it is actually used, not by who owns it. Connection logs or CloudWatch connection metrics over a few weeks usually make the class obvious.
| Access pattern | Typical example | Strategy | Why it fits |
|---|---|---|---|
| Working-hours only | Per-developer feature database | Scheduled stop/start | Idle windows are predictable, so a schedule captures most savings with no resume delay during the day |
| CI-driven bursts | Integration test database | Serverless v2 with a low minimum | Load arrives unpredictably and briefly, so capacity follows demand without scheduling logic |
| Rarely touched | Demo or archived branch environment | Auto-pause, or a snapshot restored on demand | Long idle gaps make a resume delay acceptable. Stopped RDS instances restart automatically after seven days, which makes stopping a poor fit here |
| Shared staging | Pre-release environment used across teams | Always-on, sized like production | Different teams use it at unpredictable times, and unexpected unavailability blocks releases |
Some databases need no managed instance at all. A local or containerized database works for unit tests and schema development. Several small dev schemas can run on one shared instance, which removes per-instance floors. The cost is weaker isolation, plus noisy-neighbor effects.
Staging is where matching production matters most. If production is provisioned and staging scales or pauses, staging hides the problems you need to catch. Cold-start latency, connection storms after a resume, and connection pool timeouts can look like application bugs, or real bugs can go unnoticed. Keep cost tricks in environments where capacity behavior is not what you are testing.
What are the alternatives to Serverless v2 and stop/start?
Serverless v2 and stop/start are not the only ways to cut dev database cost. Several alternatives work without pausing anything, and they suit different trade-offs:
- Right-size provisioned instances. Many dev databases run on an instance class copied from production. A small burstable class is often enough for a single developer, and it bills a low fixed rate with no resume latency. This is the simplest change and needs no automation.
- Snapshot and delete, then restore on demand. For environments that sit untouched for weeks, take a final snapshot, delete the database, and restore from the snapshot when someone needs it. You pay only snapshot storage while it is gone, and the seven-day automatic restart no longer applies. The trade-off is restore time, which is longer than a start, plus a new endpoint unless you reuse the same identifier.
- Aurora cloning. Aurora can create a clone of a cluster that shares the source's storage pages and copies only pages that change. A clone of a large dataset is created faster than a full restore and initially adds little storage. That makes short-lived per-developer or per-branch copies cheaper to create and throw away than long-lived full copies.
- Shared instance with per-developer schemas or databases. One instance hosts many small dev schemas, so you pay one compute floor instead of many. You give up isolation: one developer's heavy query or schema migration affects everyone on that instance.
- Local or containerized databases. Running the same engine and major version locally or in CI costs nothing in cloud compute or storage and starts fast. It does not reproduce managed-service behavior such as failover, parameter groups, or IAM authentication, so keep a managed environment for tests that depend on those.
- Reserved capacity for always-on environments. Staging that must run around the clock gains nothing from pausing. RDS and Aurora offer reserved instances for provisioned capacity, which lower the hourly rate in exchange for a term commitment. That fits a stable, long-lived environment, not a fleet of disposable dev databases.
These combine well. A common layout is local databases for unit tests, cloned or snapshot-restored copies for feature work, a scheduled or auto-paused tier for per-developer environments, and a right-sized, always-on staging.
How do you implement scheduled stop/start with tags and on-demand wake-up?
The scheduled job
The core is a function triggered on a schedule, for example by EventBridge Scheduler, which lets you set a named time zone instead of doing UTC arithmetic. It lists databases, keeps only those carrying an opt-in tag such as auto-stop=true, skips any with an override tag like keep-awake-until, and calls StopDBInstance or StopDBCluster. A morning schedule calls the matching start APIs. The example that follows uses this pattern. Selecting by tag rather than by name means new databases join the schedule when they are tagged, with no change to the code.
AWS automatically starts a stopped database after seven days. Run the stop job daily, not only on Friday evenings, so it catches databases that came back on their own.
Wake-up and opt-out
Give developers a self-service path, such as a chat command, a CLI wrapper, or a pipeline job, that starts a database or sets the override tag with an expiry. A manual ticket asking someone to start a database can block a developer for an hour. A tagged override takes seconds and leaves an audit trail.
Cold starts in CI and health checks
Starting a database takes minutes. CI jobs should poll database status until it is available, then connect with retries, exponential backoff, and an overall timeout sized for a full start. Health checks should report a stopped database as stopped, not as failed.
Operational risks
A scheduler with an expired IAM permission fails silently, and the bill shows it weeks later. Alert on job errors and on tagged databases still running after the stop window. Check that schedule time zones account for daylight saving changes.
import boto3
from datetime import datetime, timezone
rds = boto3.client("rds")
def override_active(tags, now):
# keep-awake-until holds an ISO 8601 timestamp, e.g. 2026-11-12T22:00:00+00:00
value = tags.get("keep-awake-until")
if not value:
return False
try:
until = datetime.fromisoformat(value)
except ValueError:
print(f"Malformed keep-awake-until '{value}', honoring it as an override")
return True # err on the side of not stopping someone's database
if until.tzinfo is None:
until = until.replace(tzinfo=timezone.utc)
return until > now
def handler(event, context):
now = datetime.now(timezone.utc)
stopped, failures = [], []
for page in rds.get_paginator("describe_db_clusters").paginate():
for cluster in page["DBClusters"]:
tags = {t["Key"]: t["Value"] for t in cluster.get("TagList", [])}
# Opt-in by tag. Running daily also re-stops clusters AWS auto-started after 7 days.
if tags.get("auto-stop") != "true" or cluster["Status"] != "available":
continue
if override_active(tags, now):
continue
cid = cluster["DBClusterIdentifier"]
try:
rds.stop_db_cluster(DBClusterIdentifier=cid)
stopped.append(cid)
except Exception as exc: # e.g. AccessDenied after an IAM change
failures.append(f"{cid}: {exc}")
print(f"Stopped: {stopped}")
if failures:
# Fail the invocation so the error metric and alarm fire instead of failing silently
raise RuntimeError("Stop failed for: " + "; ".join(failures))
return {"stopped": stopped}
A scheduled Lambda handler that stops Aurora clusters tagged auto-stop=true, skips clusters with an unexpired keep-awake-until override, and raises an error on any failed stop so alerting can catch it.
How can it save engineering time?
The cost savings show up on the bill. The time savings are less visible, but they come from removing manual, interrupt-driven work:
- No manual stop/start requests. Without automation, someone has to remember to stop databases, and developers file requests to start them. A tag-driven schedule and a self-service wake-up path remove both the reminder and the request queue.
- No scheduler to maintain, with auto-pause. Serverless v2 scale to zero pauses and resumes on activity alone. For sporadically used environments, nothing has to be written, deployed, or monitored, and there is no seven-day restart to catch. You trade that for resume latency and the need to remove idle connections that keep the cluster awake.
- Onboarding by tag. Because the scheduled job selects databases by tag, adding a new environment means setting
auto-stop=trueat creation, ideally in the same infrastructure code that creates it. Nobody edits a list of identifiers. - Fewer cost investigations. Unexplained increases on a dev bill usually trace back to a database that restarted after seven days, a forgotten branch environment, or old snapshots. The daily re-stop job, alerts on tagged databases still running, and expiry-based cleanup catch these before someone has to dig through billing data.
- Faster environment creation. Cloning or restoring from a snapshot through a script gives a developer a working copy without waiting on another team, and a TTL tag means nobody has to remember to remove it.
Illustrative estimate (assumed inputs, not a measured result). Assume a team of 20 developers, each needing a stopped database started twice a month, and assume each manual request costs 30 minutes of blocked time once you count waiting for someone to act and the start itself. That is 20 × 2 × 0.5 = 20 hours of blocked developer time per month. A self-service start still incurs the several-minute start, but removes the waiting. Replace these inputs with your own request counts and response times.
The automation itself is not free. Someone owns the scheduled job, its IAM permissions, its alerts, and the cleanup rules. Keep that code small and boring, as in the example above, so maintaining it costs less time than it saves.
When should you avoid pausing, and what costs remain after compute is solved?
Pausing or Serverless v2 is a poor fit in four cases:
- Steady workloads. A dev database that is busy most of the working day gains little from pausing. Serverless v2 can cost more than a provisioned instance at a constant load, because you pay a per-ACU premium for elasticity you don't use.
- Latency-sensitive workflows. A database resuming from zero, or an instance starting from stopped, makes the first connection wait or fail. Integration suites and demo environments with short client timeouts will report this as an outage.
- Unsupported engines or configurations. Scale to zero, Serverless v2, and stop/start each have engine, version, and feature limits. Check them for your exact engine version before you plan around them.
- Production parity. Staging used for performance or failover testing should match production's instance class and topology. Otherwise its results don't tell you how production will behave.
Fixing compute leaves storage-side costs, and these keep billing even when the database is stopped:
| Leftover cost | Why it persists | Fix |
|---|---|---|
| Orphaned manual snapshots | Not deleted with the database | Tag with owner and expiry, then prune |
| Long backup retention | Defaults copied from production | Shorten for dev |
| Oversized allocated storage | RDS storage can grow but not shrink | Size small and enable autoscaling |
| Per-branch/PR databases | Nothing removes them after merge | Apply a TTL tag and delete on PR close |
Tag every database with owner and expires-at, and run a scheduled job that deletes or alerts on anything past its expiry.
Decision checklist
- Is usage predictable enough to schedule?
- Can callers tolerate first-query latency?
- Do your engine and version support the option?
- Who maintains the schedules and the cleanup?
- Does this environment need production parity?
How OneEnv can help
Disclosure: OneEnv is the product behind this blog.
OneEnv (oneenv.io) is a workspace-based governance platform for the things services share — environment variables, database structure, API routes and validation rules. A change to a shared value is staged on a branch, reviewed once, and then every affected service explicitly approves or rejects it before it goes live, so you can see who a change touches before it ships instead of finding out in production.
Applied to aurora serverless v2 cost, this is where it helps:
Saves time
- Every service that inherits a shared value is listed in one place, so nobody searches repos and chats to find out who is affected.
- One review per branch replaces coordinating each team separately; each service still keeps its own approve/reject.
- Changing a shared variable is one edit and one review instead of editing every service's
.envby hand.
Saves cost
- Fewer production incidents and rollbacks caused by a shared value, route or column changing under a consumer unannounced.
- Less duplicated configuration to maintain: one shared definition inherited by many services.
- A wrong or stale value is caught at review time by the services it affects, not by a failed deploy.
- OneEnv has a free plan (1 workspace, unlimited services and members, full governance), so trying it costs nothing.
These are qualitative benefits, not measured results — how much you save depends on how many services share the value.
Want to try it? Start at oneenv.io.