dynobase-icon
Dynobase

Question: How do you store JSON on DynamoDB?

Rafal Wilinski

Answered by Rafal Wilinski

Last updated: October 23rd, 2026

Answer

Store JSON as native DynamoDB attributes using a document client: objects become Maps, arrays become Lists, and primitive values keep their supported types. You do not need to stringify the document.

import { DynamoDBClient } from "@aws-sdk/client-dynamodb"; import { DynamoDBDocumentClient, PutCommand } from "@aws-sdk/lib-dynamodb"; const ddb = DynamoDBDocumentClient.from(new DynamoDBClient({})); await ddb.send(new PutCommand({ TableName: "Orders", Item: { pk: "ORDER#42", shipping: { city: "Seattle" }, items: [{ sku: "BOOK#1", quantity: 2 }], paid: false, }, }));

This assumes a String partition key named pk. Add the sort key if the table requires one. PutCommand replaces an existing item with the same key; use a condition for create-only behavior or UpdateCommand for partial changes.

Plain JSON differs from DynamoDB JSON, where values have descriptors such as S, N and M. Document clients perform that conversion. Java users can use the SDK 2.x Enhanced Client or Enhanced Document API rather than the retired SDK 1.x mapper.

Keep the complete item within 400 KB. Larger documents belong in S3, with their location and searchable fields stored in DynamoDB. See the JSON converter and Node.js examples.

Source: AWS JavaScript document client.

Dynobase is a Professional GUI Client for DynamoDB

Start your 7-day free trial today

Product Features

Download
/
Pricing
/
Member Portal
/
Privacy
/
EULA
/
Twitter
© 2026 Dynobase
+
Still using AWS DynamoDB Console?
Try Dynobase to accelerate your DynamoDB workflow. Start your 7-day free trial today.