How do DynamoDB on-demand and provisioned capacity modes bill?
On-demand mode bills for what you consume. Each read is metered in read request units and each write in write request units. You don't declare capacity in advance, which suits traffic you can't forecast and tables that sit idle for long stretches. Provisioned mode bills per hour for the read capacity units (RCUs) and write capacity units (WCUs) you reserve, whether or not requests arrive. You commit to a throughput level, and in exchange each unit costs less than on-demand when you keep that capacity busy.
| Dimension | On-demand | Provisioned |
|---|---|---|
| Billing basis | Request units consumed | RCU/WCU-hours reserved |
| Idle cost | None for throughput | Full reserved capacity |
| Capacity planning | None required | Required, or auto scaling |
Storage, backups, streams and data transfer are billed separately. For the most part their cost does not depend on which capacity mode you choose.
Cost depends on units consumed, not on how many requests you send. Item size is rounded up for every operation:
- Reads: one strongly consistent read covers up to 4 KB. A 4.1 KB item therefore costs two units.
- Eventually consistent reads: these cost half as much as strongly consistent reads.
- Writes: one write unit covers up to 1 KB.
- Transactions: transactional reads and writes consume twice the units of their standard equivalents.
Global secondary indexes add cost that is easy to miss. Every base-table write that touches an index's projected attributes also consumes write capacity on that index. An update that changes an index key can cost two index writes, one to remove the old entry and one to add the new one. A table with three GSIs can therefore spend several times its base write cost.
Prices differ by region and change over time. Look up current figures for your region before using any numbers in this article.
How does each capacity mode work under the hood?
Both modes meter work in the same units. They differ in what happens when a request arrives.
Provisioned mode. The RCUs and WCUs you set are a throughput limit for the table, and each GSI has its own separate limit. DynamoDB spreads that throughput across the table's partitions. When a request would push consumption past the available capacity, DynamoDB rejects it with a throttling error (ProvisionedThroughputExceededException), and the SDK retries it with backoff. Two mechanisms soften this. Burst capacity lets a table briefly spend capacity it left unused in recent minutes. Adaptive capacity shifts throughput toward partitions that receive more traffic. Neither is guaranteed, and neither lifts the per-partition limit for a single hot key. You change capacity yourself, or let auto scaling change it for you. Increases are applied while the table stays available. Decreases are limited per day.
On-demand mode. You set no throughput limit. DynamoDB tracks the table's traffic and allocates capacity based on the peaks it has already seen. It serves and bills each request in request units. Traffic that grows gradually is absorbed. A sudden jump far above any previous peak can still throttle while DynamoDB adds partitions. Per-partition limits apply in this mode as well.
Metering is identical in both modes. A read or write consumes the same number of units whichever mode the table uses. Only the price, and the decision about what to do with excess traffic, differ. Set ReturnConsumedCapacity on individual API calls to see exactly how many units an operation consumed, including the share consumed by indexes. This is the most direct way to confirm what item size, consistency level and GSI projections cost you.
Who should use on-demand, and who should use provisioned capacity?
This decision belongs to the engineers who own DynamoDB tables: service teams, platform teams that run shared tables, and anyone reviewing the DynamoDB line on the bill.
On-demand fits:
- New tables and launches that have no traffic history to size against.
- Spiky or unpredictable workloads, such as tables driven by user events, partner integrations or marketing campaigns.
- Low-duty-cycle tables, including dev, test, staging, and batch tables that sit idle most of the day.
- Small teams that would rather pay a per-request premium than own capacity planning and scaling policies.
Provisioned capacity, usually with auto scaling, fits:
- High-volume tables with steady or smoothly varying traffic, where utilization can stay above the break-even threshold described below.
- Workloads where a hard throughput ceiling is useful. Throttling acts as a cost guardrail against runaway clients.
- Long-lived tables with a stable floor. Reserved capacity can cover that floor at a lower effective price.
Most organizations end up running both: on-demand for the long tail of small or unpredictable tables, and provisioned for the few large, steady tables that make up most of the spend.
What utilization does provisioned capacity need to beat on-demand?
Provisioning a unit means paying for a full hour of capacity whether you use it or not. On-demand bills only for requests served. The break-even therefore depends on how much of each provisioned hour you actually use.
Computing the threshold
Take writes first, using placeholders for your region's current list prices:
- P_w: provisioned price per WCU-hour
- R_w: on-demand price per write request unit (list prices are quoted per million, so divide by 1,000,000)
One WCU sustains one 1 KB write per second, which is 3,600 write request units per hour at full utilization. Doing that same hour of work on-demand costs 3,600 × R_w. The break-even utilization is:
U_w = P_w / (3,600 × R_w)
Utilization here means average consumed capacity divided by provisioned capacity. If your consumption stays above U_w, provisioned is cheaper. Below it, you are paying for idle units and on-demand wins.
Reads follow the same formula with P_r and R_r, because one RCU and one read request unit both cover a strongly consistent read of up to 4 KB. Eventually consistent reads halve the cost in both modes, so they don't change the ratio.
Reserved capacity
Reserved capacity combines an upfront payment with a lower hourly rate over a one- or three-year term. To get the effective hourly price, spread the upfront fee across the term's hours and add the reduced rate. Use that as P in the formula. The result is a lower threshold, so provisioned starts to win at lower utilization. The catch is that you pay for the reservation even if traffic falls.
Recompute U for each region you run in, and again whenever AWS revises either price. A price cut in one mode can move the threshold in either direction.
HOURS_PER_YEAR = 8760
def break_even(p_unit_hour: float, r_per_million: float) -> float:
"""U = P / (3,600 x R): utilization above which provisioned is cheaper."""
r_per_request = r_per_million / 1_000_000 # list prices are quoted per million
on_demand_cost_of_full_hour = 3600 * r_per_request # 1 unit/sec for 3,600 sec
return p_unit_hour / on_demand_cost_of_full_hour
def reserved_unit_hour(upfront: float, hourly: float, units: int, years: int) -> float:
"""Effective price per unit-hour: amortized upfront fee plus reduced hourly rate.
upfront and hourly are for the whole reserved block of `units`."""
term_hours = HOURS_PER_YEAR * years
return (upfront / term_hours + hourly) / units
P_w = 0.0006 # provisioned price per WCU-hour
R_w = 1.00 # on-demand price per million write request units
print(f"Provisioned break-even: {break_even(P_w, R_w):.1%}")
P_w_reserved = reserved_unit_hour(upfront=150.0, hourly=0.01, units=100, years=1)
print(f"Reserved effective $/WCU-hour: {P_w_reserved:.6f}")
print(f"Reserved break-even: {break_even(P_w_reserved, R_w):.1%}")
A Python sketch that computes the provisioned-vs-on-demand break-even utilization U = P / (3,600 × R) from placeholder prices, then shows how amortizing a reserved-capacity upfront fee lowers the effective unit-hour price and the threshold (illustrative estimate, not real prices).
How does DynamoDB auto scaling work, and what does it cost you?
Auto scaling does not predict load. It runs a target-tracking policy that watches consumed capacity through CloudWatch alarms and changes provisioned capacity only after an alarm has breached for several consecutive datapoints. By the time new capacity is active, the spike has usually been running for a few minutes. Scale-down is slower on purpose: DynamoDB limits how many times per day you can decrease capacity, and the scale-down alarm needs a longer quiet period. After a spike, you keep paying for the peak for a while.
The target utilization sets the headroom you pay for: provisioned ≈ consumed ÷ target.
Illustrative estimate (assumed numbers, not a benchmark): a table consumes a steady 700 WCU with a 70% target. Auto scaling provisions 700 ÷ 0.70 = 1,000 WCU, so you pay for about 1.43× what you use. At a 90% target you pay for about 1.11×, but you have less margin to absorb traffic while scaling catches up.
| Time | Traffic | Provisioned | What happens |
|---|---|---|---|
| t0 | ### |
##### |
Steady state, 70% utilization |
| t+1m | ######## |
##### |
Burst credits absorb some excess (best-effort) |
| t+3m | ######## |
##### |
Burst credits are used up and requests are throttled |
| t+5m | ######## |
########### |
Scale-up takes effect |
| t+20m | ### |
########### |
Traffic drops, but capacity stays at the peak level |
| hours | ### |
##### |
Scale-down runs within the daily decrease limit |
Burst capacity comes from unused capacity saved over recent minutes. It is not guaranteed. On-demand mode also has a limit: traffic far above the table's previous peak can still be throttled while DynamoDB adds partitions. In either mode, a hot partition key throttles at per-partition limits regardless of the table's total capacity. An under-provisioned GSI also throttles writes to the base table, so size each index's write capacity for its own write traffic.
+-------------+ writes +--------------------------------------------+
| Application |------------>| Base table: provisioned WCU/RCU |
+-------------+ | +-----------+ +-----------+ +-----------+ |
^ | | partition | | partition | | hot key | |
| | | A | | B | | per-part. | |
| | | | | | | limit hit | |
| | +-----------+ +-----------+ +-----------+ |
| | burst: saved unused capacity, best-effort |
| +---+---------------------+---------------+--+
| throttled requests: v GSI writes v consumed ^
| burst gone, +-------------------+ +-------------------+ |
| hot key, or | GSI: own WCU | | CloudWatch | |
| GSI full | if under-provis., | | consumed WCU/RCU | |
| | base-table writes | +---------+---------+ |
+--------------| are throttled | | new capacity|
+-------------------+ v |
+-------------------+ |
| CloudWatch alarm | |
| breach N periods | |
+---------+---------+ |
v minutes late|
+-------------------+ |
| Target tracking | |
| provisioned = | |
| consumed/target | |
| down: daily limit |---+
+-------------------+
Auto scaling is a feedback loop: consumed capacity flows through CloudWatch metrics and alarms to a target-tracking policy that updates the table minutes later, while burst exhaustion, hot partition keys and an under-provisioned GSI can throttle writes before or regardless of that adjustment.
Worked cost models for four traffic shapes
Illustrative estimate (assumed numbers, not a benchmark). Assume $1.25 per million on-demand write request units, $0.00065 per provisioned WCU-hour, 730 hours per month, 1 KB writes, and writes only. Check current regional pricing before reusing these.
- On-demand = total writes × price per write
- Fixed = peak WCU × 730 × WCU-hour price
- Auto scaling = Σ(hourly demand ÷ target utilization, floored at minimum) × WCU-hour price
The assumed shapes are:
- Flat: 100 writes/s all month.
- Diurnal: 400/s for 12 h/day, then 40/s.
- Batch: 5/s idle, plus a 30-minute daily burst at 2,000/s.
- Viral: 50/s baseline, plus four unpredictable hours per month at 5,000/s.
Auto scaling uses a 70% target utilization.
| Shape | On-demand | Fixed at peak | Auto scaling (70%) |
|---|---|---|---|
| Flat | $328.50 | $47.45 | $67.85 |
| Diurnal | $722.70 | $189.80 | $149.00 |
| Batch | $153.00 | $949.00 | $173.60 |
| Viral | $253.40 | $2,372.50 | $88.90, with throttling |
For the batch shape, the model assumes capacity stays at about 2,857 WCU for 3 hours a day. That covers the ramp, the burst, and the delayed scale-down. Auto scaling reacts to CloudWatch alarms over minutes, and scale-downs are rate-limited, so you pay for headroom well beyond the 30-minute burst. That headroom is why auto scaling costs more than on-demand here.
The viral auto-scaling figure looks cheapest, but the model is optimistic. A step from 50/s to 5,000/s arrives faster than scaling can respond, so most of the spike throttles. The realistic choice for that shape is between on-demand and fixed peak provisioning.
As duty cycle falls, the 70% target and the scale-down lag consume an increasing share of provisioned savings.
When should you avoid provisioned capacity, and when should you avoid on-demand?
Provisioned capacity is a poor fit when you cannot predict the shape. That includes spiky, bursty, or low-duty-cycle tables, and any table whose traffic is set by someone else's release schedule. The savings depend on keeping utilization high. Unpredictable load forces you to carry headroom, and auto scaling's reaction time means you either throttle or over-provision. Reserved capacity raises the stakes further. It is a commitment to a baseline over a fixed term. If the workload is migrated, consolidated, or retired before that term ends, you keep paying for capacity nothing uses.
On-demand is a poor fit for large, steady, well-understood tables. For those tables you can hold utilization near target, so on-demand's per-request premium buys flexibility you don't need.
On-demand's less obvious risk is that its cost has no ceiling. In provisioned mode, a runaway backfill, a client retry storm, or scraping traffic hits the provisioned limit and throttles. In on-demand mode, the same traffic is served and billed. A failure that would otherwise show up as a latency incident shows up as an invoice instead.
| Situation | Avoid | Reason |
|---|---|---|
| Spiky or unpredictable traffic | Provisioned | Headroom and scaling lag erase savings |
| Low duty cycle (batch, dev, staging) | Provisioned | You pay for idle capacity |
| Workload may be retired within a term | Reserved capacity | Commitment outlives usage |
| Large, steady, forecastable load | On-demand | Per-request premium buys nothing |
| Exposure to untrusted or buggy clients | On-demand without controls | Abuse becomes cost, not throttling |
If you choose on-demand, add the limits it lacks:
- Budgets and billing alarms scoped to the table or service.
- CloudWatch alarms on consumed capacity, so an anomaly surfaces in hours rather than at month end.
- Application-level rate limiting, with retries that use backoff and jitter so failures don't amplify.
What are the alternatives to a straight on-demand vs provisioned choice?
The choice is not binary. Within DynamoDB you have several ways to configure capacity, and several ways to reduce the capacity you need at all.
Capacity configurations:
- Provisioned at a fixed level. This is the simplest provisioned option. It suits flat traffic, and it doubles as a hard cost ceiling.
- Provisioned with auto scaling. Use this for traffic that changes predictably and gradually, such as daily cycles. You tune the target utilization and the minimum and maximum capacity.
- Provisioned with scheduled changes. If you know when a batch job or business-hours peak starts, raising capacity just before it avoids auto scaling's reaction lag. You can do this with scheduled scaling actions or by calling
UpdateTablefrom a job. Decreases still count against the daily limit. - Reserved capacity on top of provisioned. Use it for the stable floor of long-lived tables. Auto scaling or on-demand-style headroom covers the rest.
- Splitting workloads across tables. A table that mixes a steady workload with a bursty one forces a single mode onto both. Separating them lets each table use the mode that fits its own shape.
Reducing consumption instead of re-pricing it:
- Caching hot reads in the application or in a cache layer in front of the table, so repeated reads don't consume capacity.
- Batching and buffering writes through a queue, so bursts reach the table at a steady rate that provisioned capacity can absorb.
- The design changes listed in the process section below: fixing hot keys, shrinking items, using eventually consistent reads, and trimming GSI projections.
These options combine. A common pattern is on-demand for new and unpredictable tables, then provisioned with auto scaling and a reserved floor once a table's shape is known.
How do you measure your table's traffic shape in CloudWatch?
Use aws cloudwatch get-metric-statistics against the AWS/DynamoDB namespace, with --period 60 and --statistics Sum. Query ConsumedReadCapacityUnits and ConsumedWriteCapacityUnits with the TableName dimension for the base table. Add the GlobalSecondaryIndexName dimension to query each GSI separately. GSIs have their own capacity and can throttle writes to the base table, so a table-level view alone is incomplete. One call returns at most 1,440 datapoints, which is one day at one-minute resolution, so loop over days. One-minute data is retained for about 15 days. Longer windows fall back to five-minute and hourly granularity, which flattens peaks, so export the data regularly if you want weeks of fine-grained history.
Divide each one-minute Sum by 60 to get average units per second for that minute, the same unit provisioned capacity uses. Do not use the Average statistic. For these metrics it reports consumption per request, not per second, so it tells you nothing about throughput. Even Sum/60 hides bursts shorter than a minute, so treat it as a lower bound on instantaneous peak.
From two or more representative weeks, compute two ratios:
- Average-to-peak: mean per-second consumption divided by the high percentile you plan for, such as p99 of the per-minute values. This shows how spiky the traffic is.
- Consumed-to-provisioned: consumption divided by
ProvisionedReadCapacityUnitsorProvisionedWriteCapacityUnits. This shows how much provisioned capacity you are paying for and not using.
Then check ReadThrottleEvents, WriteThrottleEvents, and ThrottledRequests for the same periods. If throttling appears at a given utilization, you need more headroom than that. If you see no throttling across your peak windows, you can provision closer to observed consumption.
#!/usr/bin/env bash
set -euo pipefail
TABLE="orders"; GSIS=("by-customer" "by-status"); DAYS=14; REGION="us-east-1"
TODAY=$(date -u +%Y-%m-%d)
fetch() {
local metric=$1 div=$2 out=$3; shift 3
for d in $(seq "$DAYS" -1 1); do
aws cloudwatch get-metric-statistics --region "$REGION" \
--namespace AWS/DynamoDB --metric-name "$metric" --dimensions "$@" \
--start-time "$(date -u -d "$TODAY -$d days" +%Y-%m-%dT%H:%M:%SZ)" \
--end-time "$(date -u -d "$TODAY -$((d - 1)) days" +%Y-%m-%dT%H:%M:%SZ)" \
--period 60 --statistics Sum \
--query 'Datapoints[].[Timestamp,Sum]' --output text
done | sort | awk -v div="$div" '{printf "%s %.2f\n", $1, $2/div}' > "$out"
}
stats() {
sort -k2 -n "$1" | awk -v f="$1" '{v[NR]=$2; s+=$2} END {
if (NR == 0) { print f ": no data"; exit }
i = int(NR * 0.99); if (i < 1) i = 1
printf "%s mean=%.1f/s p99=%.1f/s avg-to-peak=%.2f\n", f, s/NR, v[i], (v[i] > 0 ? s/NR/v[i] : 0) }'
}
TDIM="Name=TableName,Value=$TABLE"
for m in ConsumedReadCapacityUnits ConsumedWriteCapacityUnits; do
fetch "$m" 60 "$TABLE.$m.tsv" "$TDIM" && stats "$TABLE.$m.tsv"
for g in "${GSIS[@]}"; do # each GSI has its own capacity and can throttle base-table writes
fetch "$m" 60 "$TABLE.$g.$m.tsv" "$TDIM" "Name=GlobalSecondaryIndexName,Value=$g" \
&& stats "$TABLE.$g.$m.tsv"
done
done
for m in ReadThrottleEvents WriteThrottleEvents; do
fetch "$m" 1 "$TABLE.$m.tsv" "$TDIM"
awk -v m="$m" '$2 > 0 {n++} END {printf "%s: %d minutes with throttling\n", m, n}' "$TABLE.$m.tsv"
done
A bash script that loops get-metric-statistics one day at a time with --period 60 and Sum for the base table and each GSI, divides by 60 to get units per second, reports mean, p99 and the average-to-peak ratio, and counts the minutes that had throttle events.
What is a practical process for choosing a DynamoDB capacity mode?
Treat the capacity mode as a decision you revisit on a schedule, driven by data you have already collected.
- Start new or unknown workloads on on-demand. You have no traffic history to size against, and under-provisioning shows up as throttling in production.
- Collect at least a few weeks of consumed-capacity metrics, covering your weekly cycle and any known peak events such as month-end batch jobs.
- Compute utilization against the break-even threshold from earlier: average consumed capacity divided by the provisioned capacity you would need to absorb peaks without throttling.
- Switch to provisioned with auto scaling only when utilization stays above break-even. If the steady floor is stable over months, consider reserved capacity for that floor and let auto scaling cover the rest.
DynamoDB limits how often you can switch a table between modes. Because of that, a mode switch cannot be your response to a traffic spike, and a wrong choice stays in place until the limit allows another switch. Make the change deliberately, during a quiet period.
Before changing modes, check whether these changes would cut capacity consumption more:
- Fix hot partition keys. A hot key forces you to provision for the hottest partition instead of the table average.
- Shrink items. Capacity units are billed in size increments, so moving large attributes elsewhere reduces the cost of every read and write.
- Use eventually consistent reads where your application can tolerate them. They cost half as much as strongly consistent reads.
- Trim GSI projections. Every write to the base table also writes the projected attributes to each index.
Spend tuning effort on the few tables that make up most of the bill. Tuning dozens of small tables can cost more engineer time than it saves. On-demand also removes ongoing capacity planning, which has value even when it costs more per request.
How can the right capacity mode save engineering time?
The capacity mode changes how much operational work a table creates, not only what it costs.
- On-demand removes capacity work for most tables. You don't size capacity, tune auto scaling targets and limits, or respond to throttling caused by under-provisioning. For the long tail of small, idle or unpredictable tables, that work usually costs more in engineer time than the per-request premium costs on the bill.
- Fewer throttling incidents. Tables that don't fit provisioned capacity, such as spiky or batch tables, tend to produce recurring alerts and capacity tickets. Moving them to on-demand, or adding scheduled capacity ahead of known peaks, removes a source of repeated interruptions.
- Decisions based on data, not debate. The break-even formula and the CloudWatch script turn "should this table be provisioned?" into a repeatable check. You can run it for every table in a scheduled review instead of re-arguing each case.
- Effort concentrated where it pays. Ranking tables by spend and tuning only the top few means engineers make capacity decisions on a handful of tables, and the rest stay on a default that needs no attention.
- Guardrails instead of investigations. Budgets, billing alarms and consumed-capacity alarms on on-demand tables catch runaway traffic early, before it requires a month-end cost investigation.
Set a default for your organization, for example "on-demand unless a table's measured utilization stays above break-even", and document the review cadence. With that in place, most capacity questions are answered by the policy, not by a new analysis each time.
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 route's URL or method automatically notifies the services that consume it — no hunting through repos for callers.
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.
- Consumers learn about a breaking change at review time rather than from production errors.
- 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.