DynamoDB Limits and Quotas
DynamoDB enforces limits on item size, key length, request size, and the number of indexes. Knowing these numbers early prevents redesign work later. A limit is a fixed rule, while a quota is a default that AWS can raise on request.
The Road Sign Picture
Roads carry speed limits and weight limits. Drivers who know the signs plan routes and avoid fines. DynamoDB limits work like those signs. A designer who reads them early chooses a data model that fits the road.
Item and Attribute Limits
| Item | Limit |
|---|---|
| Maximum item size | 400 KB, including attribute names and values |
| Partition key value | Up to 2,048 bytes |
| Sort key value | Up to 1,024 bytes |
| Number precision | Up to 38 digits |
| Nesting depth of maps and lists | 32 levels |
The 400 KB rule covers everything in the item. Long attribute names consume part of the budget, and large content such as images belongs in Amazon S3.
Table and Index Limits
- Table names use 3 to 255 characters from letters, digits, underscore, hyphen, and period.
- A table supports up to 5 local secondary indexes.
- A table supports up to 20 global secondary indexes by default.
- Local secondary indexes limit each item collection (all items sharing one partition key) to 10 GB.
- Primary key attributes must be String, Number, or Binary.
Request Limits
| Operation | Limit |
|---|---|
| Query or Scan response | 1 MB of data per call |
| BatchGetItem | 100 items, 16 MB |
| BatchWriteItem | 25 requests, 16 MB |
| Transaction | 100 actions, 4 MB total |
| Expression length | 4 KB |
Time-Based Limits
- Point-in-time recovery restores any second within the last 35 days at most.
- Stream records stay available for 24 hours.
- TTL removes expired items within 48 hours of expiry.
- A transaction client token protects against duplicate requests for 10 minutes.
Throughput Limits
Each partition supports 3,000 read capacity units and 1,000 write capacity units per second. Account-level and table-level throughput quotas also exist. Those quotas differ by Region and AWS can raise them. Open the Service Quotas page in the AWS console to see the current values for your account.
Diagram: Where Limits Apply
Account / Region
└── Table quotas (tables per Region, throughput)
└── Table
├── Index limits (5 LSI, 20 GSI)
└── Partition limits (3,000 RCU, 1,000 WCU)
└── Item limits (400 KB)
└── Attribute limits (nesting depth 32)
Working Around Common Limits
Item Too Large
Move large values to S3 and store the object key in DynamoDB. Split one big item into several smaller items that share a partition key.
Result Set Too Large
Page through results with LastEvaluatedKey. One Query call never returns more than 1 MB.
Too Many Indexes
Reuse one index for several access patterns through generic key attributes. Remove indexes that no query uses.
Hot Partition
Add a suffix to a busy key and spread writes across shards.
Checking Limits Before Launch
- Estimate the largest realistic item size.
- Count the access patterns and the indexes they require.
- Confirm account quotas for expected traffic.
- Read the official AWS quotas page again before each major launch, because AWS updates values over time.
Summary
- An item holds up to 400 KB including attribute names.
- A table supports 5 local and 20 global secondary indexes by default.
- Query and Scan return 1 MB per call, and batches and transactions cap at fixed counts.
- Time limits cover backups, streams, and TTL deletion.
- Service Quotas shows the adjustable values for your account.
