What this thread does
Do first: use S3 PutObject for the payload, then send DynamoDB PutItem an Item containing its primary key and durable S3 bucket/key reference instead of the oversized attribute.
Short answer
As of November 2026, this card follows current DynamoDB and S3 service documentation. The maximum item size in DynamoDB is 400 KB, including attribute name binary length and attribute value lengths; KB means 1024 bytes (limits). S3 and DynamoDB do not share a transaction, so publication and cleanup need explicit failure handling (large-item guide).
Choose / don't choose
- S3 pointer: choose for an opaque document or binary payload retrieved after a metadata lookup; don't expect DynamoDB to filter inside S3 bytes. Josh Hart's June 21, 2022 design describes a second call to retrieve the large object and loss of transactional consistency across multiple data stores.
- Compression: choose when the compressed attribute fits. Compressed attribute values are not useful for filtering (guide).
- Split items: choose when smaller logical pieces need independent keyed access; don't assume one request returns an unlimited item collection (Hart).
Not for: choosing a preferences database; see postgres-jsonb-or-dynamodb-user-preferences.
Settings that matter
| Setting or flag | Value / default | Applies to | Source |
|---|---|---|---|
Item | Include every table key and retained metadata plus application-defined bucket/key attributes; omit the large payload. A put replaces the entire old item | DynamoDB current docs, November 2026 | PutItem |
Bucket, Key, Body | Actual S3 bucket, durable object key, and payload bytes; keep that same bucket/key pair in the item | client.put_object example | put_object |
Metadata | String-to-string map containing the owning item's complete primary key, including sort key if present; metadata key labels are application-defined | S3 PutObject | SDK map, back-reference |
ConditionExpression | For create-only publication, attribute_not_exists on the partition key; for replacement, use an explicit expected-state condition | DynamoDB PutItem | conditional put |
ConsistentRead | true for base-table reconciliation after an uncertain write outcome; default is eventual | DynamoDB GetItem | GetItem |
Order of operations
1. Allocate a distinct immutable object key for this attempted publication. Preserve enough durable attempt information to reconcile a crash. This is an application recovery policy derived from the documented absence of cross-service transactions (guide). 2. Complete PutObject with owner-key metadata before publishing the DynamoDB reference. Keep searchable fields in the DynamoDB item. The linked implementation writes the large object to an S3 bucket, then creates a DynamoDB item (design). 3. Write a size-bounded Item, retaining all metadata that must survive replacement. Item is a map of attribute name/value pairs, one for each attribute; the bucket/key labels are your schema, not reserved DynamoDB settings (PutItem). 4. If the DynamoDB operation definitively fails, schedule deletion of this attempt's unreferenced object. If the outcome is uncertain after a timeout, read the owning item with GetItem and ConsistentRead: true; compare the exact reference before deciding. Do not delete an object that a successful item references (GetItem). 5. Run a durable reconciler for crashes between the two writes. Use S3 owner metadata to find the parent, then remove only confirmed orphans after in-flight attempts are resolved. Coordinate cleanup with publication so a late retry cannot publish an already deleted key. Keep the previous referenced object until replacement succeeds; this compensating design is application policy (guide).
Known failures and fixes
Diagnostic: ValidationException
| Error (short quote) | Cause | Fix | Source |
|---|---|---|---|
ValidationException | The complete retained item exceeds 400 KB | Remove the large attribute and remeasure names plus values, including the reference | guide, limits |
ConditionalCheckFailedException | A condition specified in the operation failed to be evaluated | Read the current item; reconcile this attempt's S3 object before retrying a changed business operation | PutItem errors |
John Rotenstein's answer also distinguishes item size from a single attribute. Current official constraints govern the limit. With local secondary indexes, also account for the documented combined item/index-entry restriction (limits).
Missing
- No atomic commit spans these services. Retry ownership, reconciliation retention, object versioning and authorization must be designed for the application's writers; a blind delete immediately after a network timeout is insufficient.
Checked
2026-11-12; current DynamoDB large-item, limit, PutItem/GetItem and S3 SDK references, Hart's dated design and Rotenstein's dated answer read. No AWS operations executed.
Started from a post by @Amazon Web Services, packaged by the editor. Original post