Can DynamoDB store arrays?
Yes. DynamoDB stores arrays using the List (L) type — an ordered collection that can hold mixed types including strings, numbers, booleans, nulls, maps, and nested lists. For unordered collections of unique values, it also offers String, Number, and Binary Sets. There is no element-count limit as long as the item stays under 400 KB.
Lists (ordered arrays)
A List preserves order and allows duplicates and mixed types. It maps directly to a JSON array and can nest (lists of maps, lists of lists) up to 32 levels deep.
That documented limit counts the value at the bottom. Wrapping a string in 31 nested L containers writes fine; a 32nd container fails, and the same boundary applies to nested M:
ValidationException: Nesting Levels have exceeded supported limits:
Attributes in the item have nested levels beyond supported limitSets (unique values)
- String Set (SS), Number Set (NS), Binary Set (BS) hold unique values of one type, unordered.
- A set cannot be empty (that raises a
ValidationException).
Use a Set when membership and uniqueness matter; use a List when order or mixed types matter.
Sets reorder and reject duplicates
Store ["zulu", "alpha", "mike"] as a String Set and it reads back ["alpha", "mike", "zulu"]. A Number Set sorts numerically: ["30", "4", "100"] returns ["4", "30", "100"]. The same values in a List come back in the order you wrote them.
A repeated member is a hard failure rather than a silent de-duplication:
ValidationException: Input collection contains duplicatesAnd since a set can never be empty, DELETE-ing its last member removes the attribute. Code that expects an empty set back gets a missing attribute instead, so test with attribute_exists rather than for length zero.
How many elements actually fit
"No element-count limit" is accurate and hard to act on. The usable answer is 400 KB divided by what one element costs: a list carries 3 bytes of overhead, then each element's own size plus 1 byte.
For 36-character UUID strings under a one-character partition key, that lands at 11,070 elements. Adding an 11,071st is rejected:
ValidationException: Item size has exceeded the maximum allowed sizeThe item size calculator sizes those two items at 409,599 and 409,636 bytes, so it draws the 409,600-byte line exactly where the engine does. Writing the larger one costs 400 write units.
Go deeper
See DynamoDB data types and convert nested structures with the JSON converter. Download DynoTable to edit list and set attributes.
References
- Supported data types and naming rules in Amazon DynamoDB — Amazon DynamoDB Developer Guide
- Constraints in Amazon DynamoDB — Amazon DynamoDB Developer Guide
- Quotas in Amazon DynamoDB — Amazon DynamoDB Developer Guide
Last verified 2026-07-13 against the official AWS documentation linked above.
Measured and reproduced 2026-07-28 against DynamoDB Local 3.3.0 via @aws-sdk/client-dynamodb 3.1095.0 — the element count, the nesting boundary, the set round trips and the error strings above are engine output, not estimates. Wording of the error strings may differ on the live service.