How does DynamoDB bill on-demand and provisioned capacity?
DynamoDB offers two capacity modes because there are two kinds of buyers: teams who cannot predict their traffic, and teams who can and want a lower price for that predictability.
On-demand bills per request. Each read consumes read request units (RRUs) and each write consumes write request units (WRUs). Idle time costs nothing for throughput, but every request is billed, including requests during a sustained peak.
Provisioned bills per read capacity unit (RCU) and write capacity unit (WCU) per hour. You pay for the capacity you reserve whether or not requests use it. Autoscaling can adjust that capacity, but it reacts to consumed capacity after the change has happened.
How requests become units
The unit math is the same in both modes:
- Reads are rounded up to 4 KB. A strongly consistent read costs 1 unit per 4 KB. An eventually consistent read costs half that. A transactional read costs double. A 9 KB item rounds up to 12 KB, so it costs 3 units strongly consistent or 1.5 units eventually consistent.
- Writes are rounded up to 1 KB, at 1 unit per KB. A 1.2 KB item costs 2 units. Transactional writes cost double.
Trimming item size and using eventually consistent reads where your API can tolerate them reduces cost in either mode. These savings apply before you choose a mode at all.
| Dimension | On-demand | Provisioned |
|---|---|---|
| Billing unit | Per request unit consumed | Per capacity unit per hour reserved |
| Cost ceiling | None by default; scales with traffic | Bounded by provisioned and autoscaling maximums |
| Throttling behavior | Rare, but possible on very sudden jumps far above previous peaks | Throttles when demand exceeds capacity plus limited burst credit |
| Tuning effort | Minimal | Ongoing: autoscaling targets, minimums, maximums |
What is the break-even utilization between on-demand and provisioned?
A provisioned write capacity unit (WCU) can serve one standard write per second, which is 3,600 writes per hour. You pay its hourly price whether you use it or not. If on-demand served the same 3,600 writes, you would pay 3,600 times the per-write-request-unit price. The break-even utilization is the ratio of the two:
break-even = provisioned price per WCU-hour ÷ (3,600 × on-demand price per write request unit)
Reads use the same formula, with RCU-hour and read request unit prices. Provisioned capacity is cheaper only when average consumed capacity divided by provisioned capacity stays above this ratio. Below it, you are paying for idle headroom that costs more than on-demand would have cost for the traffic you actually served.
Take both prices from the current AWS pricing page for your region and table class. Prices differ by region and change over time, so a ratio copied from a blog post or an old spreadsheet can point you to the wrong mode.
The accompanying script takes four inputs:
- the WCU-hour price
- the RCU-hour price
- the per-request-unit prices
- a series of hourly samples of consumed and provisioned capacity
For reads and writes separately, it prints the break-even ratio and the utilization you achieved.
Feed the script hourly data, not daily or monthly averages. Provisioned capacity bills for every hour at the level you set. Averages hide this. A table that runs at 90% for six peak hours and 10% overnight can show a respectable daily average. Those idle overnight hours are still billed at full provisioned rates, and only the hourly view shows where the money goes.
#!/usr/bin/env python3
# Break-even utilization for DynamoDB provisioned vs on-demand.
# Prices are required arguments: copy them from the current AWS pricing page
# for your region and table class. Nothing is hardcoded.
# CSV columns: hour,consumed_rcu,provisioned_rcu,consumed_wcu,provisioned_wcu
# Each value is the hourly average in capacity units per second.
import argparse, csv
p = argparse.ArgumentParser()
p.add_argument("samples", help="CSV of hourly capacity samples")
p.add_argument("--rcu-hour", type=float, required=True) # provisioned $ per RCU-hour
p.add_argument("--wcu-hour", type=float, required=True) # provisioned $ per WCU-hour
p.add_argument("--rru", type=float, required=True) # on-demand $ per read request unit
p.add_argument("--wru", type=float, required=True) # on-demand $ per write request unit
a = p.parse_args()
with open(a.samples, newline="") as f:
rows = list(csv.DictReader(f))
def report(kind, unit_hour_price, request_price):
# One unit fully used serves 3,600 request units per hour.
breakeven = unit_hour_price / (3600 * request_price)
# Sum hour by hour: every provisioned hour is billed, idle or not.
consumed = sum(float(r[f"consumed_{kind}"]) for r in rows)
provisioned = sum(float(r[f"provisioned_{kind}"]) for r in rows)
util = consumed / provisioned if provisioned else 0.0
prov_cost = provisioned * unit_hour_price
od_cost = consumed * 3600 * request_price
winner = "provisioned" if util > breakeven else "on-demand"
print(f"{kind.upper()}: break-even {breakeven:.1%}, achieved {util:.1%} "
f"over {len(rows)} h -> {winner} "
f"(provisioned ${prov_cost:.2f} vs on-demand ${od_cost:.2f})")
report("rcu", a.rcu_hour, a.rru)
report("wcu", a.wcu_hour, a.wru)
# Example (placeholder prices; substitute your region's current rates):
# python3 breakeven.py samples.csv --rcu-hour 0.0001 --wcu-hour 0.0005 \
# --rru 0.0000001 --wru 0.0000005
A Python script that takes current regional prices and hourly consumed and provisioned capacity samples, then prints the break-even ratio, the achieved utilization, and the resulting cost of each mode for reads and writes separately.
Worked example: an API with a steady baseline, daily peak and spikes
The hourly view is where the three billing options separate. The figures below are an illustrative estimate built on placeholder prices. Substitute your region's current rates before relying on any conclusion.
Assumed inputs (writes only, 30-day month):
- On-demand: $1.25 per million write request units.
- Provisioned: $0.00065 per WCU-hour.
- Baseline: 100 writes/s for 18 hours a day.
- Daily peak: 600 writes/s for 6 hours.
- Spikes: two 10-minute bursts to 1,500 writes/s each day.
That traffic totals about 21.1M writes per day and 634M per month, which averages roughly 244 writes/s.
| Option | Provisioned WCU | Monthly cost | Effective utilization |
|---|---|---|---|
| On-demand | n/a | ~$792 | n/a (pay per request) |
| Fixed, sized for spikes | 1,500 | ~$702 | ~16% |
| Fixed, sized for peak | 600 | ~$281 | ~41%, spikes throttle |
| Autoscaled, 70% target | ~143 to ~857 | ~$150 | ~70%, spikes at risk |
WCU 0 300 600 900 1200 1500
00-08 ██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
08-14 ██████████████░░░░░░░░░░░░░░░░░░
10:15 ████████████████████████████████ (spike)
14-24 ██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
In the chart, █ is consumed capacity and █ plus ░ is the fixed 1,500 WCU you pay for.
A WCU used at 100% costs about $0.18 per million writes. That puts break-even near 14% utilization.
Sizing a fixed table for the spikes lands at about 16%, just above break-even. If spikes double, or the baseline halves, that option drops below 14% and on-demand becomes the cheaper choice.
Autoscaling wins on cost because it tracks the daily peak. It cannot react within a 10-minute spike, so its savings depend on whether the spikes can tolerate throttling.
+------------------------------------------+
| API write traffic (illustrative estimate)|
| baseline 100/s for 18h, peak 600/s for 6h|
| two 10-min spikes/day to 1,500/s |
| ~634M writes/month, avg ~244 writes/s |
+---------------------+--------------------+
|
+------------------+---------+--------+------------------+
| | | |
v v v v
+----------------+ +----------------+ +----------------+ +----------------+
| On-demand | | Fixed, spikes | | Fixed, peak | | Autoscaled, 70%|
| $1.25/M WRU | | 1,500 WCU | | 600 WCU | | ~143-857 WCU |
| ~$792/month | | ~$702/month | | ~$281/month | | ~$150/month |
| util n/a | | util ~16% | | util ~41% | | util ~70% |
| pay per request| | just above 14% | | spikes throttle| | spikes at risk |
+----------------+ +----------------+ +----------------+ +----------------+
| | | |
v v v v
+-------------------------------------------------------------------------+
| Break-even ~14% utilization: a fully used WCU costs ~$0.18 per M writes |
| Below 14%: on-demand is cheaper. Above 14%: provisioned is cheaper. |
| Spikes x2 or baseline /2 pushes fixed-for-spikes below 14% |
+-------------------------------------------------------------------------+
Illustrative estimate using placeholder prices: one sample write-traffic profile priced under four capacity options, with the effective utilization each option reaches compared against the ~14% break-even point.
Why does traffic shape matter more than traffic volume?
Average traffic sets the bill only for on-demand. A provisioned table pays for the capacity it holds, so its real cost depends on how much headroom you keep above consumption. Three properties set that headroom:
- Peak-to-average ratio. Capacity sized for the peak sits idle the rest of the day. A 4:1 ratio caps a fixed allocation at 25% average utilization.
- Spike arrival speed. A gradual morning ramp can be followed. A surge that doubles traffic in a minute cannot.
- Spike duration. A spike shorter than the scaling reaction time is over before new capacity arrives.
How autoscaling responds
Provisioned autoscaling is target tracking. You set a utilization target and minimum and maximum capacity bounds. Autoscaling watches consumed capacity over a window of minutes and adjusts provisioned capacity to keep the ratio near the target. Because it reacts only after it sees sustained load, the gap between the target and 100% is the only buffer you have during that lag.
For example, a table might use a 70% target, a minimum of 200 WCU and a maximum of 2,000 WCU. These values are an illustrative configuration, not a recommendation. At 70%, the table can absorb roughly a 43% jump before throttling, because 1 ÷ 0.7 ≈ 1.43.
The target is a trade-off:
- A higher target (for example, 85%) improves utilization but leaves about an 18% buffer.
- A lower target (for example, 50%) tolerates a doubling of traffic but pays for twice the capacity it uses. That erodes the savings over on-demand.
Why throttling costs more than it saves
When the buffer runs out, requests are throttled. SDK retries add latency and load at the worst moment. Requests that exhaust their retries reach clients as errors. A cost optimization has become a reliability incident.
#!/usr/bin/env bash
# Illustrative target-tracking setup for a provisioned table's write capacity.
# Values match the section's example (70% target, 200-2000 WCU); they are not a recommendation.
set -euo pipefail
TABLE="orders-api" # placeholder table name
# 1. Register the table's WCU as a scalable target with min/max bounds.
# The minimum is the floor you always pay for; the maximum caps runaway spend.
aws application-autoscaling register-scalable-target \
--service-namespace dynamodb \
--resource-id "table/${TABLE}" \
--scalable-dimension "dynamodb:table:WriteCapacityUnits" \
--min-capacity 200 \
--max-capacity 2000
# 2. Attach a target-tracking policy that keeps consumed/provisioned near 70%.
# The 30% gap above the target is the only buffer while autoscaling reacts.
# Raising TargetValue improves utilization but shrinks that buffer.
aws application-autoscaling put-scaling-policy \
--service-namespace dynamodb \
--resource-id "table/${TABLE}" \
--scalable-dimension "dynamodb:table:WriteCapacityUnits" \
--policy-name "${TABLE}-wcu-target-70" \
--policy-type TargetTrackingScaling \
--target-tracking-scaling-policy-configuration '{
"TargetValue": 70.0,
"PredefinedMetricSpecification": {
"PredefinedMetricType": "DynamoDBWriteCapacityUtilization"
}
}'
# Read capacity and each global secondary index are scaled separately and
# need their own scalable target and policy.
Registers a provisioned table's write capacity with Application Auto Scaling using 200–2,000 WCU bounds and a 70% target-tracking utilization policy.
What capacity planning inputs do you need before choosing a mode?
Start from measured traffic, not estimates. Collect these per table:
- Requests per second by operation type. Reads, writes, queries, scans, and transactional calls each consume capacity differently. Transactional reads and writes cost twice the standard rate.
- Average item size. Writes are metered in 1 KB increments and reads in 4 KB increments, rounded up. A 1.1 KB item costs two write units per write, so the size distribution matters more than the mean.
- Read consistency mix. An eventually consistent read costs half as much as a strongly consistent one. Moving a hot read path to eventual consistency can halve its read cost.
- Hourly and daily variation. You need the shape of traffic, not only its total.
Then account for multipliers. Each global secondary index consumes its own write capacity whenever a base-table write touches attributes the index projects. A table with three GSIs can consume up to four times its base write capacity. In provisioned mode, each index is sized and autoscaled separately. An under-provisioned GSI throttles writes to the base table, so every index needs its own headroom. That extra headroom raises the utilization you must sustain before provisioned mode becomes cheaper.
For historical consumption, pull ConsumedReadCapacityUnits and ConsumedWriteCapacityUnits from the AWS/DynamoDB CloudWatch namespace. Use aws cloudwatch get-metric-statistics with the TableName dimension, --period 3600 or shorter, and --statistics Sum. Add the GlobalSecondaryIndexName dimension to get per-index figures. To convert a Sum to an average per-second rate, divide it by the period length in seconds. Cover at least several full weeks, including a known peak event.
#!/usr/bin/env bash
# Pull hourly consumed write capacity for a table and each of its GSIs,
# then convert hourly Sums into average WCU per second.
set -euo pipefail
TABLE="orders" # placeholder table name
GSIS=("by-customer" "by-status") # placeholder GSI names
PERIOD=3600 # 1-hour buckets
START=$(date -u -d '28 days ago' +%Y-%m-%dT%H:%M:%SZ) # GNU date
END=$(date -u +%Y-%m-%dT%H:%M:%SZ)
# 28 days x 24 hours = 672 datapoints, under the 1,440-per-call limit.
fetch() {
# $1 is a label, the remaining arguments are the --dimensions values
local label=$1; shift
aws cloudwatch get-metric-statistics \
--namespace AWS/DynamoDB \
--metric-name ConsumedWriteCapacityUnits \
--dimensions "$@" \
--start-time "$START" --end-time "$END" \
--period "$PERIOD" --statistics Sum \
--query 'Datapoints[].[Timestamp,Sum]' --output text |
sort |
# The Sum is total WCU in the hour. Dividing by the period gives average WCU/s.
awk -v p="$PERIOD" -v l="$label" '{ printf "%s\t%s\t%.2f\n", l, $1, $2 / p }'
}
# Base table: TableName dimension only
fetch "$TABLE" Name=TableName,Value="$TABLE"
# Each GSI consumes its own write capacity, so query each one separately
for gsi in "${GSIS[@]}"; do
fetch "$TABLE/$gsi" Name=TableName,Value="$TABLE" Name=GlobalSecondaryIndexName,Value="$gsi"
done
Fetches four weeks of hourly ConsumedWriteCapacityUnits for a base table and each of its GSIs with the AWS CLI, then converts each hourly Sum into an average per-second write rate.
When should you avoid provisioned capacity or on-demand?
Where provisioned capacity is the wrong choice
Provisioned capacity pays off only when you can forecast load. For a new API, or one whose traffic depends on customer behavior you haven't observed yet, you will either over-provision and waste money or under-provision and throttle. Short, sharp spikes are a specific problem. Autoscaling reacts to CloudWatch metrics over several minutes, so a burst that lasts a few minutes can throttle before capacity rises. Burst capacity covers only a small amount of that gap.
Small tables are another case. If the savings come to a few dollars a month, they rarely justify the work of tuning autoscaling targets, setting capacity on each GSI, and responding to throttling alerts. A team without anyone to own that tuning should not choose provisioned mode at all.
Where on-demand is the wrong choice
If traffic is sustained, steady and close to a known level around the clock, on-demand charges a premium for elasticity you don't use.
On-demand also has limits:
- It can still throttle. Capacity adapts to previously observed peaks. A sudden jump far beyond that peak can be throttled while the table scales.
- Hot partition keys hurt in both modes. Per-partition throughput limits apply regardless of billing mode.
- There is no natural cost ceiling. A bug, a retry storm without backoff, or an abusive client becomes billable traffic immediately.
To limit cost exposure, set a maximum on-demand throughput on the table and its indexes where your region and SDK support it. Also create billing alarms and CloudWatch alarms on consumed capacity, set well above normal peak so that runaway traffic triggers them.
What are the alternatives, and how should you decide and switch modes?
Four options are realistically available, and they differ in how much engineering time they consume as well as in price.
- On-demand charges per request and needs no capacity planning.
- Fixed provisioned sets a constant read/write capacity. It is cheapest per unit when fully used and throttles when exceeded.
- Autoscaled provisioned adjusts capacity toward a target utilization. It lags sudden spikes, so it needs headroom.
- Reserved capacity is a term commitment against a provisioned baseline in a region.
Reserved capacity discounts capacity you pay for whether or not you consume it. Commit only to the floor you are confident will persist for the whole term. If traffic declines, a feature is retired, or the table is redesigned (for example, a new key schema or a move to single-table design), the commitment keeps billing for capacity nothing uses.
A practical process:
- Launch new or unpredictable APIs on on-demand.
- Collect consumed capacity per table and index over representative periods, including month-end, releases and seasonal peaks.
- Compute break-even against your actual traffic shape.
- Switch only if the savings hold across those periods.
AWS limits how often a table can change billing mode, so you cannot flip modes in reaction to a single bad day. Base the decision on sustained patterns.
| Option | Ongoing cost | Engineering time | Main risk |
|---|---|---|---|
| On-demand | Highest per request, zero idle cost | Minimal | Unbounded spend on runaway traffic |
| Fixed provisioned | Lowest if fully used | Periodic resizing | Throttling or idle waste |
| Autoscaled provisioned | Low with steady, gradual curves | Tuning targets, min/max | Lag on sharp spikes |
| Reserved capacity | Lowest for committed baseline | Forecasting, renewal reviews | Paying for unused commitment |
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 dynamodb on-demand vs provisioned, 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.