AWS DynamoDB Capacity Calculator

Capacity units only, with no prices, because prices differ per region and go stale in a page like this. The arithmetic is what people get wrong anyway.

Paste below, or drop a file anywhere on this panel

Or drop a file anywhere on this panel. Nothing is uploaded: the analysis runs in this tab.

The answer appears here

Paste on the left and press Calculate. Nothing leaves this tab.

Examples

Real input you can load into the tool above. Each one shows a different thing going wrong, because that is what the tool is for.

Two global secondary indexes

Each write is charged three times, not once

item size: 6
reads per second: 100
writes per second: 50
indexes: 2

More writes than a partition can take

Throttles at 1,000 write units however much the table has

item size: 1
writes per second: 2000

A scan with a filter

Charged for the whole table, however few items come back

item size: 2
reads per second: 10
scan with a filter expression

Common mistakes

These are the ones that fail silently. The config is accepted, nothing raises an error, and the consequence arrives later.

  1. Sizing capacity from the write rate alone

    Each global secondary index is charged as an extra write, so three indexes make every write cost four times what the table alone suggests.

    Instead:Multiply by the number of indexes plus one, and project only the attributes each index needs.

  2. Provisioning a large amount of capacity and still being throttled

    Capacity is spread across partitions by partition key, and one partition serves at most 3,000 read units and 1,000 write units.

    Instead:Check that the partition key spreads the load. A sequential key such as a timestamp sends everything to one partition.

  3. Using a Scan with a filter to find a few items

    The filter runs after the read, so you are charged for every item in the table.

    Instead:Design a key or an index that supports a Query.

A write is charged once for the table and once for every index

A 6 KB item written to a table with three global secondary indexes costs 24 write units, not 6. This is the usual reason a table's bill is several times what the write rate suggests.

An index that projects ALL is charged on every write to the item

Even when the attribute that changed is not one the index is queried on. Projecting only what each index needs is the single largest lever on a write-heavy table.

A throttled index throttles the table

If a global secondary index runs out of write capacity, the back pressure reaches the base table and writes start failing there. The error names the table, so the index is the last place anybody looks.

Reads round up to 4 KB and writes round up to 1 KB

A 4.1 KB item costs the same to read as an 8 KB one. Attribute names count toward the item size, so shortening them is one of the few optimisations that is purely arithmetic.

Eventually consistent reads cost half, and are the default

GetItem, Query and Scan are all eventually consistent unless ConsistentRead is set. A global secondary index cannot be read strongly consistently at all, which is occasionally the reason a design has to change.

A single partition tops out at 3,000 read units

However much the table is provisioned. If the traffic concentrates on one partition key it throttles there, and the error is a plain ProvisionedThroughputExceededException that says nothing about partitions. Writes cap at 1,000, which a timestamp partition key hits by construction.

A filter on a Scan does not reduce what is read

DynamoDB reads the whole table, charges for every item, then applies the filter. A Scan that returns three items can consume the capacity of the entire table, which makes it a table design problem rather than a query problem.