Limits in DynamoDB
This section describes current limits within Amazon DynamoDB (or no limit, in some cases). Each limit listed below applies on a per-region basis unless otherwise specified.
Topics
Capacity Units and Provisioned Throughput
Capacity Unit Sizes
One read capacity unit = one strongly consistent read per second, or two eventually consistent reads per second, for items up to 4 KB in size.
One write capacity unit = one write per second, for items up to 1 KB in size.
Provisioned Throughput Minimums and Maximums
For any table or global secondary index, the minimum settings for provisioned throughput are 1 read capacity unit and 1 write capacity unit.
An AWS account places some initial maximum limits on the throughput you can provision:
US East (N. Virginia) Region:
Per table – 40,000 read capacity units and 40,000 write capacity units
Per account – 80,000 read capacity units and 80,000 write capacity units
All Other Regions:
Per table – 10,000 read capacity units and 10,000 write capacity units
Per account – 20,000 read capacity units and 20,000 write capacity units
The provisioned throughput limit includes the sum of the capacity of the table together with the capacity of all of its global secondary indexes.
You can request an increase on any of these limits. For more information, see https://aws.amazon.com/support.
In the AWS Management Console, you can see what your current provisioned capacity is in a given region and make sure you are not too close to the limits. If you increased your default limits, you can use the DescribeLimits operation to see the current limit values.
Increasing Provisioned Throughput
You can increase ReadCapacityUnits or WriteCapacityUnits
as often as necessary, using the AWS Management Console or the UpdateTable
operation. In a single call, you can increase the provisioned throughput for a
table, for any global secondary indexes on that table, or for any combination of these. The new
settings do not take effect until the UpdateTable operation is
complete.
You cannot exceed your per-account limits when you add provisioned capacity, and DynamoDB will not permit you to increase provisioned capacity extremely rapidly. Aside from these restrictions, you can increase the provisioned capacity for your tables as high as you need. For more information about per-account limits, see the preceding section Provisioned Throughput Minimums and Maximums.
Decreasing Provisioned Throughput
You can decrease the ReadCapacityUnits or
WriteCapacityUnits settings for a table, but no
more than four times per
table in a single UTC calendar day. In a single operation,
you can decrease the provisioned throughput for a table, for any global secondary indexes on
that table, or for any combination of these.
For every table and global secondary index in an UpdateTable
operation, you can decrease ReadCapacityUnits or
WriteCapacityUnits (or both). The new settings do
not take effect until the UpdateTable operation is
complete.
Tables
Table Size
There is no practical limit on a table's size. Tables are unconstrained in terms of the number of items or the number of bytes.
Tables Per Account
For any AWS account, there is an initial limit of 256 tables per region.
You can request an increase on this limit. For more information, go to https://aws.amazon.com/support.
Secondary Indexes
Secondary Indexes Per Table
You can define a maximum of 5 local secondary indexes and 5 global secondary indexes per table.
Projected Secondary Index Attributes Per Table
You can project a total of up to 20 attributes into all of a table's local and global secondary indexes. This only applies to user-specified projected attributes.
In a CreateTable operation, if you specify a
ProjectionType of INCLUDE,
the total count of attributes specified in
NonKeyAttributes, summed across all of the
secondary indexes, must not exceed 20. If you project the
same attribute name into two different indexes, this counts as two distinct
attributes when determining the total.
This limit does not apply for secondary indexes with a
ProjectionType of
KEYS_ONLY or ALL.
Partition Keys and Sort Keys
Partition Key Length
The minimum length of a partition key value is 1 byte. The maximum length is 2048 bytes.
Partition Key Values
There is no practical limit on the number of distinct partition key values, for tables or for secondary indexes.
Sort Key Length
The minimum length of a sort key value is 1 byte. The maximum length is 1024 bytes.
Sort Key Values
In general, there is no practical limit on the number of distinct sort key values per partition key value.
The exception is for tables with local secondary indexes. With a local secondary index, there is a limit on item collection sizes: For every distinct partition key value, the total sizes of all table and index items cannot exceed 10 GB. This might constrain the number of sort keys per partition key value. For more information, see Item Collection Size Limit.
Naming Rules
Table Names and Secondary Index Names
Names for tables and secondary indexes must be at least 3 characters long, but no greater than 255 characters long. Allowed characters are:
A-Za-z0-9_(underscore)-(hyphen).(dot)
Attribute Names
In general, an attribute name must be at least 1 character long, but no greater than 64 KB long.
The exceptions are listed below. These attribute names must be no greater than 255 characters long:
Secondary index partition key names.
Secondary index sort key names.
The names of any user-specified projected attributes (applicable only to local secondary indexes). In a
CreateTableoperation, if you specify aProjectionTypeofINCLUDE, then the names of the attributes in theNonKeyAttributesparameter are length-restricted. TheKEYS_ONLYandALLprojection types are not affected.
These attribute names must be encoded using UTF-8, and the total size of each name (after encoding) cannot exceed 255 bytes.
Data Types
String
The length of a String is constrained by the maximum item size of 400 KB.
Strings are Unicode with UTF-8 binary encoding. Because UTF-8 is a variable width encoding, DynamoDB determines the length of a String using its UTF-8 bytes.
Number
A Number can have up to 38 digits of precision, and can be positive, negative, or zero.
Positive range:
1E-130to9.9999999999999999999999999999999999999E+125Negative range:
-9.9999999999999999999999999999999999999E+125to-1E-130
DynamoDB uses JSON strings to represent Number data in requests and replies. For more information, see DynamoDB Low-Level API.
If number precision is important, you should pass numbers to DynamoDB using strings that you convert from a number type.
Binary
The length of a Binary is constrained by the maximum item size of 400 KB.
Applications that work with Binary attributes must encode the data in Base64 format before sending it to DynamoDB. Upon receipt of the data, DynamoDB decodes it into an unsigned byte array and uses that as the length of the attribute.
Items
Item Size
The maximum item size in DynamoDB is 400 KB, which includes both attribute name binary length (UTF-8 length) and attribute value lengths (again binary length). The attribute name counts towards the size limit.
For example, consider an item with two attributes: one attribute named "shirt-color" with value "R" and another attribute named "shirt-size" with value "M". The total size of that item is 23 bytes.
Item Size for Tables With Local Secondary Indexes
For each local secondary index on a table, there is a 400 KB limit on the total of the following:
The size of an item's data in the table.
The size of the local secondary index entry corresponding to that item, including its key values and projected attributes.
Attributes
Attribute Name-Value Pairs Per Item
The cumulative size of attributes per item must fit within the maximum DynamoDB item size (400 KB).
Number of Values in List, Map, or Set
There is no limit on the number of values in a List, a Map, or a Set, as long as the item containing the values fits within the 400 KB item size limit.
Attribute Values
An attribute value cannot be an empty String or empty Set (String Set, Number Set, or Binary Set). However, empty Lists and Maps are allowed.
Nested Attribute Depth
DynamoDB supports nested attributes up to 32 levels deep.
Expression Parameters
Expression parameters include
ProjectionExpression,
ConditionExpression,
UpdateExpression, and
FilterExpression.
Lengths
The maximum length of any expression string is 4 KB. For example, the size
of the ConditionExpression
a=b is three bytes.
The maximum length of any single expression attribute name or expression
attribute value is 255 bytes. For example, #name is five bytes;
:val is four bytes.
The maximum length of all substitution variables in an expression is 2 MB.
This is the sum of the lengths of all
ExpressionAttributeNames and
ExpressionAttributeValues.
Operators and Operands
The maximum number of operators or functions allowed in an
UpdateExpression is 300. For example, the
UpdateExpression
SET a = :val1 + :val2 + :val3 contains two "+"
operators.
The maximum number of operands for the IN comparator is
100
Reserved Words
DynamoDB does not prevent you from using names that conflict with reserved words. (For a complete list, see Reserved Words in DynamoDB.)
However, if you use a reserved word in an expression parameter, you must
also specify ExpressionAttributeNames. For more information,
see Using Placeholders for Attribute Names and Values.
DynamoDB Streams
Simultaneous Readers of a Shard in DynamoDB Streams
Do not allow more than two processes to read from the same DynamoDB Streams shard at the same time. Exceeding this limit can result in request throttling.
Maximum Write Capacity for a Table With a Stream Enabled
The following write capacity limits apply for tables with DynamoDB Streams enabled:
US East (N. Virginia) Region:
Per table – 40,000 write capacity units
Per account – 80,000 write capacity units
All Other Regions:
Per table – 10,000 write capacity units
Per account – 20,000 write capacity units
API-Specific Limits
CreateTable/UpdateTable/DeleteTableIn general, you can have up to 10
CreateTable,UpdateTable, andDeleteTablerequests running simultaneously (in any combination). In other words, the total number of tables in theCREATING,UPDATINGorDELETINGstate cannot exceed 10.The only exception is when you are creating a table with one or more secondary indexes. You can have up to 5 such requests running at a time; however, if the table or index specifications are complex, DynamoDB might temporarily reduce the number of concurrent requests below 5.
BatchGetItemA single
BatchGetItemoperation can retrieve a maximum of 100 items. The total size of all the items retrieved cannot exceed 16 MB.
BatchWriteItemA single
BatchWriteItemoperation can contain up to 25PutItemorDeleteItemrequests. The total size of all the items written cannot exceed 16 MB.
DescribeLimitsDescribeLimitsshould only be called periodically. You can expect throttling errors if you call it more than once in a minute.
QueryThe result set from a
Queryis limited to 1 MB per call. You can use theLastEvaluatedKeyfrom the query response to retrieve more results.
ScanThe result set from a
Scanis limited to 1 MB per call. You can use theLastEvaluatedKeyfrom the scan response to retrieve more results.

