How does DynamoDB bill on-demand and provisioned capacity?
DynamoDB gives you two ways to pay for throughput, and the choice comes down to who carries the risk of unused capacity: you or AWS.
Provisioned capacity bills by the hour for the read capacity units (RCUs) and write capacity units (WCUs) you configure on a table and its global secondary indexes. The meter runs whether traffic arrives or not. A table provisioned for 1,000 WCUs costs the same at 3 a.m. with zero writes as it does at peak. In return, the per-unit rate is lower. If requests exceed what you provisioned, DynamoDB throttles them once any burst allowance is used up.
On-demand capacity bills per read request unit and write request unit actually consumed. You configure no throughput, and idle hours cost nothing for reads and writes. The trade-off is a higher price per unit of work. You are paying AWS to absorb the uncertainty of your traffic pattern.
| Provisioned | On-demand | |
|---|---|---|
| Billing unit | RCU/WCU per hour, as configured | Request units, as consumed |
| Idle cost | Full provisioned rate | None for throughput |
| Per-unit price | Lower | Higher |
| Over-limit behavior | Throttling | Scales automatically, within account and table limits |
| Planning effort | Capacity targets, often with auto scaling | Minimal |
Storage, backups, streams, and data transfer are billed the same way in both modes, so only the throughput line of your bill changes. Capacity mode is set per table, which lets you run steady, predictable tables on provisioned capacity and spiky or new ones on on-demand within the same account.
Who should use this break-even analysis?
This analysis is for engineers and platform teams who own DynamoDB tables where throughput is a meaningful part of the bill, and who need to decide or defend a capacity mode for each table. It is most useful in these situations:
- You run a mix of tables. Some carry steady service traffic and others serve batch jobs, internal tools or new features. Each one may belong in a different mode.
- A table has run on on-demand for a while. You now have enough history to check whether its traffic has settled into a predictable shape.
- A provisioned table throttles or sits mostly idle. Both are signs that the configured capacity does not fit the traffic.
- You are considering reserved capacity. You need to know how much of your consumption is a durable floor before you commit to a term.
If your tables are small and their throughput cost is minor compared to storage or other services, you can skip the analysis. Leave them on on-demand. The engineering time is better spent elsewhere.
How does each capacity mode work under the hood?
Both modes store data the same way. DynamoDB splits a table into partitions by the hash of the partition key, and each partition has its own throughput limit. The capacity mode changes how DynamoDB decides how much throughput the table as a whole may consume, and what you are charged for.
In provisioned mode, you declare read and write capacity for the table and for each GSI. DynamoDB spreads that capacity across the table's partitions. Each request consumes units based on item size and consistency, as described in the next section. When consumption exceeds the provisioned rate and burst capacity is used up, requests fail with a throttling error, and the SDKs retry them with backoff. Adaptive capacity lets busier partitions use unused throughput from quieter ones, which softens uneven key distribution. It cannot raise a single partition above its hard per-partition limit. Auto scaling is a separate control loop that adjusts the provisioned numbers based on CloudWatch metrics. It does not change how throttling works.
In on-demand mode, you declare no capacity. DynamoDB tracks the table's previous traffic peak and keeps enough capacity ready to absorb sudden increases up to roughly double that peak. As sustained traffic grows, the table adds partitions and the peak it can absorb rises. A sudden jump well beyond the previous peak can still throttle while the table adapts. Per-partition limits apply exactly as in provisioned mode. You can optionally set a maximum throughput on an on-demand table to cap spend from runaway traffic.
The billing difference follows from this. Provisioned mode charges for the capacity you reserved per hour. On-demand charges for the units your requests consumed. Everything that determines how many units a request consumes is the same in both modes.
How do item size and consistency turn into capacity units?
Both modes meter work in the same units. Provisioned capacity calls them read and write capacity units (RCUs and WCUs). On-demand calls them read and write request units. The rounding rules are identical, so item size and consistency choices raise or lower the bill whichever mode you pick.
A read is billed in 4 KB increments, rounded up. A strongly consistent read of up to 4 KB costs one unit. An eventually consistent read costs half that, because DynamoDB can serve it from any replica instead of coordinating for the latest value. Writes are billed in 1 KB increments, also rounded up. Transactional reads and writes cost twice the standard amount, because of the extra coordination they require. For Query and Scan, DynamoDB sums the sizes of the returned items and rounds the total once. It does not round each item separately.
| Operation on a 6 KB item | Billed size | Units consumed |
|---|---|---|
| Eventually consistent read | 8 KB | 1 |
| Strongly consistent read | 8 KB | 2 |
| Transactional read | 8 KB | 4 |
| Standard write | 6 KB | 6 |
| Transactional write | 6 KB | 12 |
These rules explain why two changes often save more than switching modes. The first is trimming items: move large attributes to object storage or compress them. Dropping a 4.2 KB item under 4 KB halves its read cost. The second is relaxing consistency on reads that can tolerate slightly stale data, which halves their cost.
Global secondary indexes add cost too. Every write that touches an indexed attribute also consumes write units on each affected GSI, sized by the projected item. An update that changes an index key consumes two index writes, a delete and a put. Projecting only the attributes you query keeps those index writes small.
What is the break-even utilization between on-demand and provisioned?
Provisioned capacity bills for each unit per hour, whether or not you use it. On-demand bills for each request. To compare them, convert the hourly unit price into a price per request you actually serve. One write capacity unit sustains one write per second, or 3,600 writes per hour. At average utilization U, the effective cost per write is:
provisioned cost per request = hourly unit price ÷ (3,600 × U)
Set that equal to the on-demand per-request price and solve for U:
break-even U = hourly unit price ÷ (3,600 × on-demand price per request)
Above that utilization, provisioned is cheaper. Below it, on-demand is cheaper. The same formula works for reads. Prices vary by region and change over time, so take both figures from the AWS pricing page for your region.
Worked example (illustrative estimate)
The prices here are assumed, not quoted: $0.0007 per WCU-hour and $0.70 per million on-demand writes. With these inputs, break-even is 0.0007 ÷ (3,600 × 0.0000007) ≈ 28%.
| Case | Avg writes/s | Provisioned WCU | Utilization | Provisioned $/hr | On-demand $/hr |
|---|---|---|---|---|---|
| Steady | 500 | 625 | 80% | 0.44 | 1.26 |
| Spiky (8:1 peak) | 500 | 4,000 | 12.5% | 2.80 | 1.26 |
| Near-idle | 2 | 10 | 20% | 0.007 | 0.005 |
The steady and spiky tables serve identical traffic, yet each mode wins one of them. Request volume doesn't decide the outcome. What decides it is how much of the paid-for capacity sits unused, which is driven by the gap between your peak and your average.
Why does auto scaling lower the utilization you can actually reach?
Your real utilization on provisioned capacity depends on the gap between your provisioned level and what you actually consume. Auto scaling narrows that gap, but it can't close it.
Provisioned auto scaling uses target tracking. You set a target utilization, for example 70%, and it adjusts provisioned capacity to keep consumed/provisioned near that ratio. At steady state you pay for the remaining 30% as headroom. That headroom is the design, and it caps your effective utilization at the target or lower.
Scaling also lags. It reacts to CloudWatch alarms that need several consecutive datapoints, so a scale-up arrives minutes after a spike begins. Scale-down waits for a much longer period of sustained low usage, and the number of decreases per day is limited.
capacity
| ┌──────────────┐ <- provisioned (steps up late,
| ┌─────┘ ░░░░░░░░░░░░ └──────┐ steps down later)
| │ ╱╲ ░ wasted ░░░░ │
| │ ╱ ╲ ╱╲ ░░░░░░░░░ │
|──┘╱ ▲ ╲╱ ╲________________ └── <- consumed
| ╱ throttle window
+--------------------------------------> time
The trade-offs:
- Higher target (85–90%) saves money, but a spike can exhaust capacity before scaling catches up.
- Lower target (50%) absorbs spikes, but you pay for twice what you use, which erodes the cost advantage over on-demand.
- Burst capacity saves up to about five minutes of unused throughput and can absorb short spikes. DynamoDB uses it on a best-effort basis, so don't plan capacity around it.
On-demand can throttle too. Traffic that jumps far beyond a table's previous peak in a short window can be throttled while the table adapts. A hot partition key hits per-partition throughput limits in either mode, so key design matters regardless of which mode you choose.
Target tracking loop: every step reacts after the fact
┌──────────────┐ consumed RCU/WCU ┌──────────────────┐
│ DynamoDB │───────────────────>│ CloudWatch alarm │
│ table │ │ needs N datapoints│
└──────────────┘ └────────┬─────────┘
^ │ breach
│ new provisioned capacity v
│ ┌──────────────────────────┐
└────────────────────────│ Application Auto Scaling │
│ target: consumed/prov 70%│
│ up: minutes later │
│ down: much later, capped │
└──────────────────────────┘
capacity
│ ┌──────────────────────┐ provisioned steps up late
│ /\ │░░░░░░░░░░░░░░░░░░░░░░│
│ / \ /\ │░░ wasted headroom ░░░│
│ / \/ \ │░░ (paid, unused) ░░░│ ...and steps down later
│──/─▲▲───────\─┘░░░░░░░░░░░░░░░░░░░░░░└──────────── provisioned
│ / ▲▲ \___________________________________ consumed
│ ▲▲ throttled: consumed > provisioned
└──────────────────────────────────────────────────────> time
│<── lag ──>│ │<─ scale-down wait ─>│
Auto scaling reacts to CloudWatch alarms after a delay, so it throttles while it waits to scale up during a spike and then bills for unused headroom while it waits to scale down.
How do you measure your own workload's consumption in CloudWatch?
Use aws cloudwatch get-metric-statistics against the AWS/DynamoDB namespace for ConsumedReadCapacityUnits and ConsumedWriteCapacityUnits. Set the dimension TableName for the base table. For each global secondary index, run a separate query that adds GlobalSecondaryIndexName. Request the Sum statistic with a 60-second period, then divide each datapoint by 60 to get capacity units per second.
Don't rely on the Maximum statistic for these metrics. It reports the largest single request, not the per-second rate, so it understates the load you would need to provision for.
From the per-second series, derive three numbers for each table and each index:
- Average rate: the mean across the whole window.
- Peak rate: the highest one-minute value.
- Utilization: average divided by peak. This approximates what you would achieve by provisioning flat at peak. Compare it against the break-even figure from section 3.
A single call returns at most 1,440 datapoints, so pull long windows in chunks. CloudWatch also reduces resolution as data ages. One-minute data is kept for about 15 days, five-minute data for about 63 days, and one-hour data for about 15 months. Older history therefore smooths out short spikes.
The window determines the answer. A quiet two weeks can miss holiday traffic, end-of-month billing runs, quarterly reports and steady growth. Each of these raises the peak and lowers real utilization. Cover at least one full business cycle, and check how your traffic has been growing.
Sum the results across every consumer of capacity. GSIs bill their own write capacity on every base-table write that touches projected attributes. Global table replicas consume write capacity in every Region, so you need to query each Region separately. Backfills and batch jobs often create the real peak. If you analyze only base-table traffic in one Region, you will consistently underestimate consumption.
#!/usr/bin/env bash
set -euo pipefail
REGION="us-east-1" # repeat per Region for global table replicas
TABLE="orders"
GSIS=("by-customer" "by-status")
DAYS=14 # 1-minute data is only kept ~15 days
fetch() { # $1 = metric name, remaining args = dimensions
local metric=$1; shift
for d in $(seq "$DAYS" -1 1); do
aws cloudwatch get-metric-statistics --region "$REGION" \
--namespace AWS/DynamoDB --metric-name "$metric" \
--dimensions "$@" --statistics Sum --period 60 \
--start-time "$(date -u -d "-$d days" +%Y-%m-%dT%H:%M:%SZ)" \
--end-time "$(date -u -d "-$((d-1)) days" +%Y-%m-%dT%H:%M:%SZ)" \
--query 'Datapoints[].Sum' --output json
done | jq -s 'add | map(. / 60)' # Sum per minute -> units per second
}
report() { # $1 = label, $2 = metric, remaining args = dimensions
local label=$1 metric=$2; shift 2
fetch "$metric" "$@" | jq -r --arg l "$label" --argjson n $((DAYS * 1440)) '
((add // 0) / $n) as $avg | (max // 0) as $peak |
"\($l): avg=\($avg) peak=\($peak) util=\(if $peak > 0 then $avg / $peak * 100 | floor else 0 end)%"'
}
for m in ConsumedReadCapacityUnits ConsumedWriteCapacityUnits; do
report "$TABLE $m" "$m" "Name=TableName,Value=$TABLE"
for g in "${GSIS[@]}"; do # each GSI consumes and bills its own capacity
report "$TABLE/$g $m" "$m" "Name=TableName,Value=$TABLE" \
"Name=GlobalSecondaryIndexName,Value=$g"
done
done
A bash script that queries CloudWatch one day at a time for the base table and each GSI, converts one-minute Sum values to units per second, and prints average rate, peak rate and utilization for reads and writes.
When should you use reserved capacity, and what are the risks?
Reserved capacity applies only to provisioned mode. You commit to a fixed quantity of read and write capacity units in a specific Region for a one- or three-year term, pay part of the cost upfront, and get a lower hourly rate on that quantity. It does nothing for on-demand tables, and it is not available for every table class, so check that your tables qualify before you model it.
The lower rate moves the break-even point. In the earlier calculation, provisioned won once utilization passed a certain threshold. With reserved pricing, the cost of each provisioned unit drops, so the threshold drops too. A table that was marginal on provisioned at normal rates can become clearly cheaper than on-demand.
The risk is that the commitment outlasts your need for the capacity. You keep paying for the reserved units if any of these happen:
- Traffic falls because a feature is deprecated or a large customer leaves.
- A schema or access-pattern change reduces reads, such as adding a cache or denormalizing to remove a lookup.
- The table is migrated to another Region or retired.
You cannot pause reserved capacity or move it to another Region.
Reserve only the floor of your workload: the capacity you are confident will still be consumed at the end of the term. Use the minimum sustained consumption from your CloudWatch history, not the average. Then let auto scaling, at standard provisioned rates, cover everything above that floor.
What are the alternatives to switching capacity modes?
Changing the capacity mode is one lever among several. These alternatives often reduce throughput cost more, or more safely, and they work with either mode:
- Reduce units per request. As shown earlier, smaller items, eventually consistent reads where staleness is acceptable, and fewer transactional operations cut consumption in both modes. A 50% drop in consumed units halves the bill without any change to capacity planning.
- Trim GSIs. Remove indexes nobody queries, and narrow projections to the attributes you read. Every base-table write that touches an index pays again on that index.
- Cache hot reads. A read-through cache in front of the table absorbs repeated reads of the same items. This works best for read-heavy, skewed access patterns. It adds a component to operate and a staleness window to reason about.
- Use scheduled scaling for predictable cycles. If a provisioned table has a known daily or weekly shape, Application Auto Scaling scheduled actions can raise and lower the capacity bounds ahead of time. This removes some of the lag that target tracking alone suffers from.
- Smooth the traffic you control. Batch jobs, backfills and imports can often be rate-limited or spread over a longer window. This lowers the peak, which raises utilization and makes provisioned capacity viable.
- Pick the right table class. The Standard-Infrequent Access table class lowers storage cost and raises throughput cost. It suits tables that are storage-heavy and rarely read or written. It is the wrong choice for throughput-heavy tables.
- Move the workload to a different datastore. If the access pattern is mostly large scans or ad hoc analytics, a database designed for those queries, or exported data in object storage, may cost less than any DynamoDB configuration. Treat this as a design decision, not a billing tweak.
How can this approach save engineering time?
The cost of a capacity decision includes the engineering hours spent making it and maintaining it. This approach reduces those hours in a few ways.
- Defaulting new tables to on-demand removes upfront capacity planning. Nobody has to guess throughput for a feature that has not launched, and nobody gets paged for throttling caused by a wrong guess.
- A single formula replaces case-by-case debate. Once you have the break-even utilization for your region's prices, each table needs one number from CloudWatch to decide its mode. The discussion moves from opinion to measurement.
- The measurement script is reusable. Run it across tables, GSIs and Regions on a schedule, and flag tables whose utilization has crossed the break-even line in either direction. That turns the review into reading a report.
- Fewer tables need tuning. Only tables that are steady and large enough to justify it move to provisioned with auto scaling. Small and spiky tables stay on on-demand with alarms, and nobody has to maintain scaling policies for them.
- Reserving only the floor avoids rework. A conservative commitment rarely needs to be unwound, so you avoid the effort of re-planning around stranded reserved capacity.
Worked example (illustrative estimate)
Assume an account with 40 tables, and assume tuning and maintaining auto scaling policies and alarms takes about 2 engineer-hours per provisioned table per quarter. If every table were provisioned, that would be about 80 hours per quarter. If the break-even analysis shows that only 8 tables are steady and large enough to belong on provisioned, the assumed maintenance falls to about 16 hours per quarter, plus whatever time the periodic report review takes. These figures are assumed inputs, not measurements. Substitute your own table count and effort estimates.
Which capacity mode should you choose, and when should you avoid each?
Start every new table on on-demand. Until you have a few weeks of CloudWatch history, any provisioned number is a guess, and a wrong guess either throttles users or pays for idle capacity. On-demand also fits tables that stay spiky or mostly idle for good, because no utilization target can beat paying only per request when most hours carry almost no traffic.
Move to provisioned with auto scaling once traffic is steady and you can predict its daily shape. Add reserved capacity on top only for the floor you expect to keep for the whole term.
| Mode | Use when | Avoid when |
|---|---|---|
| On-demand | New, unpredictable, spiky or mostly idle tables | Unbounded spend is unacceptable and you have no alarms or limits |
| Provisioned + auto scaling | Steady, well-understood traffic | Bursts outpace scaling and throttled retries cost more than the savings |
| Reserved capacity | A durable baseline over the full term | Traffic is shrinking, migrating or uncertain |
Each mode has its own way of going wrong. Provisioned tables throttle when bursts arrive faster than auto scaling reacts. The retries add latency and errors that can be worth more than the money saved. On-demand absorbs the same burst, but a runaway client, a retry storm or a bad batch job is absorbed too, and you are billed for all of it. Put billing and consumption alarms, or a throughput cap, on on-demand tables.
Count engineering time as a cost. Tuning capacity, alarms and scaling policies can cost more than the savings on a small table, so small tables usually belong on on-demand.
DynamoDB lets you switch modes but limits how often. Treat the choice as a periodic review, not a daily toggle.
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.