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.
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 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 per-table limits only apply when you are creating a new table. At that point, DynamoDB limits the total provisioned capacity of the table itself together with all of its global secondary indexes.
You can request an increase on any of these limits. For more information, see http://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
as often as necessary, using the AWS Management Console or the
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
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
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
operation, you can decrease
WriteCapacityUnits (or both). The new settings do
not take effect until the
UpdateTable operation is
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 http://aws.amazon.com/support.
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.
CreateTable operation, if you specify a
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
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.
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:
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 a
INCLUDE, then the names of the attributes in the
NonKeyAttributesparameter are length-restricted. The
ALLprojection types are not affected.
These attribute names can contain any UTF-8 character, but the total size of the UTF-8 string after encoding cannot exceed 255 bytes.
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.
A Number can have up to 38 digits of precision, and can be positive, negative, or zero.
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.
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.
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.
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.
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 include
The maximum length of any expression string is 4 KB. For example, the size
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
Operators and Operands
The maximum number of operators or functions allowed in an
UpdateExpression is 300. For example, the
SET a = :val1 + :val2 + :val3 contains two "
The maximum number of operands for the
IN comparator is
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
ExpressionAttributeNames. For more information,
see Using Placeholders for Attribute Names and Values.
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.
In general, you can have up to 10
DeleteTablerequests running simultaneously (in any combination). In other words, the total number of tables in the
DELETINGstate 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.
BatchGetItemoperation can retrieve a maximum of 100 items. The total size of all the items retrieved cannot exceed 16 MB.
BatchWriteItemoperation can contain up to 25
DeleteItemrequests. The total size of all the items written cannot exceed 16 MB.
DescribeLimitsshould only be called periodically. You can expect throttling errors if you call it more than once in a minute.
The result set from a
Queryis limited to 1 MB per call. You can use the
LastEvaluatedKeyfrom the query response to retrieve more results.
The result set from a
Scanis limited to 1 MB per call. You can use the
LastEvaluatedKeyfrom the scan response to retrieve more results.