ValidationException: Item size has exceeded the maximum allowed size
TL;DR — A DynamoDB item can be at most 400 KB (attribute names + values combined). Your write pushes an item over that. Move the large field out (to S3, or split across items) and store a reference instead.
What it means
ValidationException: Item size has exceeded the maximum allowed sizeThe limit is 400 KB = 409,600 bytes. It counts the entire item: every attribute name plus its value, UTF-8 encoded, including nested map/list overhead. An UpdateItem that grows an existing item past 400 KB fails the same way (as an update, the message reads "Item size to update has exceeded the maximum allowed size").
Why it happens
- Storing large blobs inline — base64 images, PDFs, big JSON documents.
- An unbounded list/map (append-only arrays, event logs) that grows over time until it crosses 400 KB.
- Long attribute names multiplied across a big item.
- Denormalizing too much into a single item.
How to fix it
- Offload large values to S3. Store the object in S3 and keep only the key/URL in DynamoDB. This is the standard pattern for anything approaching the limit.
- Split the data across multiple items. Use the item-collection / vertical-partition pattern — one logical entity as several items sharing a partition key.
- Cap growing collections. Don't let a single item accumulate an unbounded list; roll entries into child items keyed by sort key.
- Compress genuinely large text before storing (gzip → binary attribute), if S3 isn't an option.
Example — reference pattern
// Instead of storing the blob inline, store an S3 pointer:
await doc.send(
new PutCommand({
TableName: 'Documents',
Item: {
pk: 'DOC#1',
title: 'Q3 report',
s3Key: 'documents/DOC#1/report.pdf', // the bytes live in S3
sizeBytes: 2_400_000
}
})
);FAQ
What is the maximum item size in DynamoDB? 400 KB (409,600 bytes) per item, counting every attribute name plus its value, UTF-8 encoded, including nested map and list overhead. An UpdateItem that grows an existing item past 400 KB fails with the same error.
How do I store data larger than 400 KB in DynamoDB? Offload the large value to S3 and keep only the key or URL in DynamoDB, split the data across multiple items that share a partition key, or compress large text into a binary attribute. Don't let a single item accumulate an unbounded list.
Reproduce it
A single item carrying a 410 KB string attribute, just over the 400 KB ceiling:
await client.send(
new PutItemCommand({
TableName: 'orders',
Item: {pk: {S: 'BIG'}, sk: {S: 'META'}, blob: {S: 'x'.repeat(410 * 1024)}}
})
);Real output:
ValidationException: Item size has exceeded the maximum allowed size
HTTP 400The message never tells you how far over you are, or which attribute did it — so when an item is assembled from several sources, measure before writing rather than bisecting after the rejection.
Related errors
- ItemCollectionSizeLimitExceededException — the 10 GB collection limit (LSI tables).
- ValidationException (overview)
- Learn: Item size & the 400 KB limit · Item collections
References
- Supported data types and naming rules in Amazon DynamoDB — Developer Guide
- BatchWriteItem — Amazon DynamoDB API Reference
- TransactWriteItems — Amazon DynamoDB API Reference
- Error handling with DynamoDB — Amazon DynamoDB Developer Guide
Last verified 2026-07-13 against the official AWS documentation linked above.
Reproduced 2026-07-26 against DynamoDB Local 2.x with AWS SDK for JavaScript v3.1095.0 — the output above is verbatim.