How does DynamoDB pricing work in on-demand and provisioned modes?

DynamoDB bills throughput in one of two ways. On-demand charges per request: every read consumes read request units (RRUs) and every write consumes write request units (WRUs), and an idle table costs nothing for throughput. Provisioned charges hourly for the read capacity units (RCUs) and write capacity units (WCUs) you configure. You pay for that capacity whether traffic uses it or not, and requests above it can be throttled.

Both modes meter work with the same unit sizes, so the rounding rules matter in either case:

Operation Unit size Units per item (e.g. 6 KB item)
Standard write 1 KB, rounded up 6
Transactional write 1 KB, rounded up, ×2 12
Strongly consistent read 4 KB, rounded up 2
Eventually consistent read 4 KB, rounded up, ×0.5 1
Transactional read 4 KB, rounded up, ×2 4

Rounding happens per item, so a 1.1 KB write costs two units. Because of this, trimming attribute names and splitting large blobs out of items lowers the bill directly.

Writes also get amplified by secondary indexes. Each write that touches a projected attribute on a global secondary index (GSI) also consumes write units on that index. When an update changes an indexed key, the index records it as a delete plus a put. In provisioned mode, each GSI has its own capacity settings. Local secondary indexes consume capacity from the base table. A table with three GSIs that project all attributes can therefore cost roughly four times as much per write as the base table alone.

The capacity mode only changes how throughput is billed. Both modes charge separately for storage, backups, streams, global table replication, and data transfer.

Where is the break-even between DynamoDB on-demand vs provisioned?

Billing differences reduce to one question: what fraction of the capacity you pay for do you actually consume? Provisioned capacity bills every hour whether or not requests arrive, so its effective price per request is the hourly unit price divided by the requests that unit actually served. On-demand bills a flat price per request. The break-even is the average utilization at which those two prices meet.

Illustrative estimate, using assumed prices and not current AWS rates: a provisioned WCU costs $0.00065 per hour, and on-demand writes cost $0.625 per million write request units. A fully used WCU serves 3,600 writes per hour, so at 100% utilization one million writes cost about $0.18. Effective cost scales as $0.18 divided by utilization.

Average WCU utilization Provisioned cost per 1M writes On-demand cost per 1M writes Cheaper mode
100% $0.18 $0.625 Provisioned
50% $0.36 $0.625 Provisioned
29% $0.62 $0.625 Roughly equal
10% $1.81 $0.625 On-demand

Under these assumptions the winner flips near 29% utilization. Two practical points follow from this:

  • Auto scaling limits your real utilization. Real utilization rarely reaches the target that auto scaling aims for, because scaling lags behind traffic changes.
  • Engineering time belongs in the comparison. Provisioned mode requires capacity planning, scaling policies and throttling alarms. On-demand requires none of these.

Prices differ by region and change over time, so take current per-region rates from the AWS pricing pages before you run this calculation on your own tables.

# Illustrative estimate only: these prices are assumptions, not current AWS rates.
# Replace them with current per-region prices from the AWS pricing pages.
WCU_PRICE_PER_HOUR = 0.00065      # assumed provisioned price per WCU-hour
ON_DEMAND_PER_MILLION = 0.625     # assumed on-demand price per 1M write request units
WRITES_PER_WCU_HOUR = 3600        # 1 WCU = 1 write/sec (items up to 1 KB) for 3,600 seconds


def provisioned_cost_per_million(utilization: float) -> float:
    """Effective provisioned cost per 1M writes at a given average utilization.

    You pay for every WCU-hour, but only `utilization` of it serves requests,
    so the price per write served rises as utilization falls.
    """
    full_use_cost = WCU_PRICE_PER_HOUR / WRITES_PER_WCU_HOUR * 1_000_000
    return full_use_cost / utilization


# Utilization at which both modes cost the same per request.
break_even = provisioned_cost_per_million(1.0) / ON_DEMAND_PER_MILLION
print(f"Break-even utilization: {break_even:.0%}")

for utilization in (1.0, 0.5, 0.29, 0.10):
    prov = provisioned_cost_per_million(utilization)
    if abs(prov - ON_DEMAND_PER_MILLION) < 0.01:
        winner = "roughly equal"
    elif prov < ON_DEMAND_PER_MILLION:
        winner = "provisioned"
    else:
        winner = "on-demand"
    print(f"{utilization:>4.0%}  provisioned ${prov:.2f}  "
          f"on-demand ${ON_DEMAND_PER_MILLION:.3f}  -> {winner}")

# Use measured average utilization, not your auto scaling target. One way to get it
# is to divide the CloudWatch ConsumedWriteCapacityUnits metric by
# ProvisionedWriteCapacityUnits over a representative period.

A Python script that uses assumed prices to calculate the effective provisioned cost per million writes at several utilization levels and the break-even point against on-demand, reproducing the illustrative table.

Which traffic shapes favor provisioned capacity, and which favor on-demand?

Volume alone does not pick the mode. A table doing heavy traffic on a smooth daily curve is cheaper provisioned, and a small table that idles and then bursts is cheaper on-demand. The deciding factor is how far peak sits above average and how predictably it arrives. Provisioned capacity bills for the line you draw, and auto scaling can only redraw that line gradually. Anything above the line is either throttled or paid for as headroom.

To measure the shape, pull ConsumedReadCapacityUnits and ConsumedWriteCapacityUnits for two to four weeks using the Sum statistic. Do not use Average, which reports a per-request figure. Divide each period's Sum by the period length in seconds to get units per second. Take the highest 1-minute rate as peak and the full-window rate as average. A ratio close to 1–2 with a repeating daily pattern points to provisioned. A high ratio, or peaks at irregular times, points to on-demand. Also check global secondary indexes separately, because their shape can differ from the base table's.

Traffic shape Favors Why
Steady diurnal load Provisioned + auto scaling Ramps are gradual and repeat daily, so scaling keeps up
Spiky or batch-triggered On-demand Bursts arrive faster than scaling reacts
Low or intermittent On-demand Idle hours cost nothing
New features On-demand No history to forecast from
Dev/test On-demand Mostly idle, and nobody tunes capacity there
Multi-tenant long-tail tables On-demand Per-table tuning doesn't pay back at small volumes

Revisit the choice for a new feature once it has a few weeks of stable metrics.

# Peak-to-average ratio for a DynamoDB table from CloudWatch consumed-capacity metrics.
from datetime import datetime, timedelta, timezone
import boto3

TABLE = "orders"          # placeholder table name
INDEX = None              # set to a GSI name to measure the index separately
DAYS = 14                 # 1-minute datapoints are retained for about 15 days
PERIOD = 60               # 1-minute buckets, so short bursts stay visible

cw = boto3.client("cloudwatch", region_name="us-east-1")
end = datetime.now(timezone.utc).replace(second=0, microsecond=0)
start = end - timedelta(days=DAYS)

def minute_sums(metric):
    dims = [{"Name": "TableName", "Value": TABLE}]
    if INDEX:
        dims.append({"Name": "GlobalSecondaryIndexName", "Value": INDEX})
    query = [{"Id": "m", "MetricStat": {
        "Metric": {"Namespace": "AWS/DynamoDB", "MetricName": metric, "Dimensions": dims},
        "Period": PERIOD,
        "Stat": "Sum",  # Sum, not Average: Average is per request, not per second
    }}]
    values = []
    for page in cw.get_paginator("get_metric_data").paginate(
            MetricDataQueries=query, StartTime=start, EndTime=end):
        values += page["MetricDataResults"][0]["Values"]
    return values

for metric in ("ConsumedReadCapacityUnits", "ConsumedWriteCapacityUnits"):
    sums = minute_sums(metric)
    if not sums:
        print(f"{metric}: no traffic in window")
        continue
    peak = max(sums) / PERIOD                  # busiest minute, in units/second
    # Divide by the full window so idle minutes (no datapoints) pull the average down
    avg = sum(sums) / (DAYS * 86400)
    print(f"{metric}: peak {peak:.1f}/s, avg {avg:.2f}/s, ratio {peak / avg:.1f}")

A boto3 script that pulls 1-minute Sum datapoints for ConsumedReadCapacityUnits and ConsumedWriteCapacityUnits, converts them to units per second, and prints the peak-to-average ratio for a table or one of its GSIs.

How does DynamoDB auto scaling for WCU and RCU actually behave?

Target tracking holds consumed capacity divided by provisioned capacity near a utilization percentage you choose, while staying inside the minimum and maximum bounds you set. It runs as a control loop:

Table consumes WCU/RCU → CloudWatch metrics → target-tracking alarms fire → Application Auto Scaling computes new capacity → UpdateTable changes provisioned WCU/RCU → table

The alarms evaluate per-minute metrics over a window, so the loop reacts to load that lasts several minutes. It does not react to a spike that lasts a few seconds. Scale-up alarms need a few consecutive breaching data points. Scale-down alarms need a much longer quiet period. The asymmetry is deliberate: scaling down too early during a lull invites throttling on the rebound, and DynamoDB also limits how often you can decrease capacity per day.

Bursts therefore land on capacity sized for the previous few minutes. DynamoDB's retained burst capacity can absorb a short overshoot, but a sustained ramp will throttle until the loop catches up.

An example configuration for a write-heavy table: minimum 100 WCU, maximum 4,000 WCU, target 70%. The minimum is your floor bill. The maximum caps a runaway client.

The target directly sets how much idle capacity you pay for. Illustrative estimate: at a steady 700 consumed WCU, a 70% target provisions about 1,000 WCU, roughly 43% headroom. A 50% target provisions 1,400 WCU, double what you use. Lowering the target absorbs bigger spikes, but every point you remove raises spend at steady state. That moves provisioned pricing closer to the on-demand break-even point from section 2.

#!/usr/bin/env bash
# Target tracking for write capacity on a provisioned-mode table.
# Placeholder table name; values match the example in the text.
set -euo pipefail

TABLE="Orders"

# 1) Register the table's WCU as a scalable target with floor and ceiling.
#    min-capacity sets the minimum bill; max-capacity limits a runaway client.
aws application-autoscaling register-scalable-target \
  --service-namespace dynamodb \
  --resource-id "table/${TABLE}" \
  --scalable-dimension "dynamodb:table:WriteCapacityUnits" \
  --min-capacity 100 \
  --max-capacity 4000

# 2) Attach a target-tracking policy that keeps consumed/provisioned WCU near 70%.
#    Application Auto Scaling creates and manages the CloudWatch alarms.
#    A lower TargetValue leaves more headroom for spikes and costs more at steady state.
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"
    }
  }'

# 3) List the alarms the policy created. The scale-out and scale-in alarms
#    use different evaluation periods.
aws application-autoscaling describe-scaling-policies \
  --service-namespace dynamodb \
  --resource-id "table/${TABLE}" \
  --query 'ScalingPolicies[].Alarms[].AlarmName'

AWS CLI commands that register a table's write capacity with Application Auto Scaling using bounds of 100–4,000 WCU, attach a 70% target-tracking policy, and list the CloudWatch alarms the policy creates.

When should you avoid each mode? Throttling, runaway bills, and commitment risk

Throttling happens in both modes

Neither mode guarantees you will never see ProvisionedThroughputExceededException. Each physical partition has its own throughput limit regardless of what the table as a whole is allowed to consume. A hot partition key, such as a single tenant, a viral item, or a timestamp-prefixed key that funnels all writes into one partition, will throttle under provisioned capacity and on-demand alike. Fix the key design. Changing the billing mode will not help.

On-demand also has a scaling limit. It adapts to traffic relative to the table's previous peak, so a sudden jump far above anything the table has served before can throttle while capacity catches up. Launches, backfills, and migrations against a cold table are the usual triggers.

Mis-sized provisioned capacity

Under-provisioning shows up as user-facing errors and latency from SDK retries. Over-provisioning fails silently: you pay for idle WCU every hour, and a table sized for a peak that rarely happens can cost more than on-demand would have.

Runaway on-demand bills

By default, on-demand has no throughput ceiling that acts as a spending brake. An infinite loop, a retry storm without backoff, or an abusive client consumes as many request units as it can generate, and you pay for every one. Set billing and per-table consumption alarms, and rate-limit at the application or API layer. Check whether a configurable maximum throughput setting is available for your tables.

The mode is not a real-time dial

AWS limits how often you can switch a table's capacity mode. Check the current rules in the AWS documentation before planning to toggle modes around traffic events.

What are the alternatives to switching capacity modes for cutting DynamoDB costs?

Reserved capacity is a term-commitment discount on provisioned throughput. Buy it only for the floor your tables never drop below, not for peaks. The commitment is tied to a region and keeps billing whether or not you use it. If a workload shrinks, gets re-architected onto a different store, or moves regions, the unused portion becomes wasted spend. Size it from the lowest sustained provisioned level over recent months, and leave auto scaling to cover everything above that.

Fixing the data model usually saves more than changing the capacity mode, because every lever below lowers the units each request consumes in either mode.

Lever Why it cuts cost
Smaller items Writes bill per 1 KB and reads per 4 KB, rounded up.
Trimmed GSI projections Each index write is billed separately. Projecting ALL copies the full item.
Eventually consistent reads These cost half as much as strongly consistent reads.
Sensible batching Batching cuts round trips and latency. It does not reduce per-item units.
TTL expiry TTL deletes consume no write capacity, and expiry shrinks storage.
Standard-IA table class Storage is cheaper, but per-request cost is higher. It fits only storage-heavy, rarely accessed tables.

Illustrative estimate (assumed numbers, not a benchmark)

The formula is: units per write = ceil(item KB) + Σ ceil(projected index entry KB) for each GSI the write touches.

  • Assumed before: a 2.6 KB item and two GSIs projecting ALL. That gives 3 + 3 + 3 = 9 units per write.
  • Assumed after: compressing attributes brings the item to 0.9 KB, and both GSIs switch to KEYS_ONLY. That gives 1 + 1 + 1 = 3 units per write.

That is a two-thirds reduction in write units, and it applies in both capacity modes.

How do you choose a capacity mode per table without wasting engineering time?

Treat the capacity mode as a per-table decision you re-check on a schedule, not a one-time architecture choice. A short, repeatable procedure keeps the analysis to an hour or two per table.

  1. Collect enough history. Export ConsumedReadCapacityUnits and ConsumedWriteCapacityUnits from CloudWatch for several weeks. Make sure the window includes month-end batch jobs, seasonal peaks and any recent launch. A quiet window will make provisioned capacity look cheaper than it is.
  2. Compute utilization. Utilization is average consumed divided by peak consumed. Calculate it separately for reads and writes, because they often have different traffic shapes.
  3. Price both modes using current rates for your region. Don't reuse old numbers from a spreadsheet. Include the headroom you would need to provision above peak.
  4. Charge for engineering time. Provisioned mode requires someone to tune auto scaling targets, keep throttling alarms in place, and respond when they fire. Include that ongoing cost in the comparison.

Illustrative estimate (assumed numbers, not a benchmark): net monthly benefit = (on-demand cost − provisioned cost) − (tuning hours per month × loaded hourly rate) Assume on-demand costs $900, provisioned costs $600, and tuning takes 3 hours per month at $100 per hour: (900 − 600) − 300 = $0. At that margin, switching gains nothing.

  1. Default new tables to on-demand. Switch a table to provisioned only after its traffic has been stable for a few weeks. Until then you have no real data to size capacity from.
  2. Tag every table with its owning service and activate those tags for cost allocation. This lets you attribute spend to a team and catch a runaway table early.
  3. Re-validate on a fixed cadence, such as quarterly. Traffic shapes, prices and the cost of your team's time all change, and the right mode for a table can change with them.
# Compute read/write utilization (average / peak) for one DynamoDB table
# from CloudWatch consumed-capacity metrics. Run before pricing both modes.
from datetime import datetime, timedelta, timezone
import boto3

TABLE = "orders-prod"   # placeholder table name
WEEKS = 6                # window should cover month-end, seasonal peaks, launches
PERIOD = 3600            # 1-hour buckets: 6 weeks = 1008 points, under the 1440-point limit

cw = boto3.client("cloudwatch", region_name="us-east-1")
end = datetime.now(timezone.utc)
start = end - timedelta(weeks=WEEKS)

def per_second_series(metric):
    resp = cw.get_metric_statistics(
        Namespace="AWS/DynamoDB",
        MetricName=metric,
        Dimensions=[{"Name": "TableName", "Value": TABLE}],
        StartTime=start,
        EndTime=end,
        Period=PERIOD,
        Statistics=["Sum"],
    )
    # Sum per bucket / seconds per bucket = average units per second in that hour.
    # Hourly buckets smooth short spikes, so the true peak is higher than this.
    return [p["Sum"] / PERIOD for p in resp["Datapoints"]]

for metric in ("ConsumedReadCapacityUnits", "ConsumedWriteCapacityUnits"):
    series = per_second_series(metric)
    if not series:
        print(f"{metric}: no data in window")
        continue
    avg, peak = sum(series) / len(series), max(series)
    util = avg / peak if peak else 0.0
    # Low utilization (spiky traffic) favors on-demand; high and steady favors provisioned.
    print(f"{metric}: avg={avg:.1f}/s peak={peak:.1f}/s utilization={util:.0%}")

A boto3 script that pulls several weeks of hourly consumed RCU/WCU from CloudWatch and reports average, peak and utilization separately for reads and writes, which feeds step 2 of the procedure.

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 .env by 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.