🌐
DynamoDB
dynobase.dev › dynamodb-table-schema-design-tool
DynamoDB Table Schema Design Tool [Free to Use]
Use this free tool to help you design your DynamoDB table schema visually and generate JSON that can then be used to create the DynamoDB table.
🌐
AWS
aws.amazon.com › blogs › database › working-with-json-data-in-amazon-dynamodb
Working with JSON data in Amazon DynamoDB | Amazon Web Services
May 1, 2023 - Amazon DynamoDB allows you to store JSON objects into attributes and perform many operations on these objects, including filtering, updating, and deleting. This is a very powerful capability because it allows applications to store objects (JSON data, arrays) directly into DynamoDB tables, and ...
Discussions

python - How can I structure my JSON schema to validate for DynamoDB and RESTAPI? - Stack Overflow
It also needs to recursively crawl ... of the JSON values to the right type. For example, floats are not supported in Dynamo, so they need to be Decimals as shown here. This is something Marshmallow make pretty easy. If there was no post_load, this is exactly what would be produced as validated_input. The second job of the schema is that it needs it to take the Python object retrieved from the DynamoDB, which looks ... More on stackoverflow.com
🌐 stackoverflow.com
December 12, 2018
amazon web services - How to export an existing dynamo table schema to json? - Stack Overflow
I'd like to replicate some dynamodb tables, schema only, into my local environment for testing purposes. First I've tried: aws dynamodb describe-table --table-name Foo > FooTable.json But it's More on stackoverflow.com
🌐 stackoverflow.com
[Source DynamoDB] Defining JSON Schema for NoSQL databases
I started working on a new connector source-dynamodb. (see the PR #14555) The way I’m thinking of developing the new connector is to add each listed table as a stream (detailed tables could be narrowed with a prefix query or directly with the IAM permissions provided). More on discuss.airbyte.io
🌐 discuss.airbyte.io
0
0
July 9, 2022
Exporting Spark dataframe to AWS DynamoDB?
We have been using https://github.com/awslabs/emr-dynamodb-connector/releases for years. More on reddit.com
🌐 r/apachespark
16
9
March 19, 2023
People also ask

What should I do with this DynamoDB JSON?
When using SDK or CLI, you need to use it as the table definition parameter when calling CreateTable operation. When using CloudFormation, SAM or Serverless Framework, paste this into your 'infrastructure-as-code' DynamoDB::Table.Properties value
🌐
dynobase.dev
dynobase.dev › dynamodb-table-schema-design-tool
DynamoDB Table Schema Design Tool [Free to Use]
How do I see DynamoDB table data?
After you've entered some data to the table, it is likely that you'll need to debug it. You can inspect table contents using AWS Console or Dynobase.
🌐
dynobase.dev
dynobase.dev › dynamodb-table-schema-design-tool
DynamoDB Table Schema Design Tool [Free to Use]
What are the ways to create DynamoDB table in AWS?
Most popular ways include AWS Console, AWS SDKs, AWS CLI, CloudFormation, Terraform, Serverless Framework, AWS SAM (Serverless Application Model) and of course Dynobase. The tool on this page is also available inside Dynobase.
🌐
dynobase.dev
dynobase.dev › dynamodb-table-schema-design-tool
DynamoDB Table Schema Design Tool [Free to Use]
🌐
GitHub
github.com › Charliekenney23 › dynamodb-json-schema
GitHub - 0xch4z/dynamodb-json-schema: Generate dynamodb table schema from json schema · GitHub
import * as fs from "fs"; import { getTableSchema } from "dynamodb-json-schema"; const USER_SCHEMA = JSON.parse(fs.readFileSync("User.json", "utf8")); const tableSchema = getTableSchema({ tableName: "users-table", hashKey: "id", itemSchema: USER_SCHEMA }); /* => { "TableName": "users-table", "KeySchema": [{ "AttributeName": "id", "AttributeType": "HASH" }], "AttributeDefinitions": [{ "AttributeName": "id", "AttributeType": "S" }] } */
Author   0xch4z
🌐
AWS re:Post
repost.aws › knowledge-center › appsync-nested-json-data-in-dynamodb
Configure AWS AppSync to handle JSON data in DynamoDB | AWS re:Post
October 7, 2022 - For Region, choose the Region that contains your DynamoDB table. For Table name, choose the table you just created. Important: Leave all other options as default. ... For more information, see Attaching a data source. ... 3. Copy and paste the following nested JSON schema into the JSON editor, and then choose Save Schema:
🌐
GitHub
github.com › shichongrui › json-schema-dynamo
GitHub - shichongrui/json-schema-dynamo
An easier way to transform objects into DynamoDB items · var transformers = require('json-schema-dynamo') var schema = { type: 'object', properties: { id: { type: 'string' }, createDate: { type: 'date' }, name: { type: 'string' }, active: { type: 'boolean' }, likes: { type: 'number' }, types: { type: 'array', items: { type: 'string' } }, userIds: { type: 'array', items: { type: 'number' } } } } var model = { id: 'asdf', createDate: new Date(), name: 'asdffdas', likes: 1, active: true, types: ['qwerty', 'ytrewq'], userIds: [1, 2, 3, 4, 5, 6, 7] } var item = transformers.fromModelToDynamoItem(s
Starred by 9 users
Forked by 3 users
Languages   JavaScript 100.0% | JavaScript 100.0%
🌐
GitHub
github.com › aws-samples › amazon-dynamodb-design-patterns › blob › master › examples › an-online-shop › json › AnOnlineShop_8.json
amazon-dynamodb-design-patterns/examples/an-online-shop/json/AnOnlineShop_8.json at master · aws-samples/amazon-dynamodb-design-patterns
"Description": "This data model represents an Amazon DynamoDB schema for an online shop.", "Version": "1.0" }, "DataModel": [ { "TableName": "OnlineShop", "KeyAttributes": { "PartitionKey": {  ...
Author   aws-samples
🌐
Codemia
codemia.io › home › knowledge hub › create a dynamodb table from json
Create a DynamoDB table from json | Codemia
July 30, 2025 - JSON File: The source file containing the data to be imported into DynamoDB. First, you need to define the table schema, which includes specifying the primary key attributes:
Find elsewhere
🌐
DEV Community
dev.to › danielbayerlein › how-to-store-json-in-amazon-dynamodb-using-aws-appsync-3956
How to store JSON in Amazon DynamoDB using AWS AppSync - DEV Community
August 5, 2020 - Instead, map the JSON within the schema. For reasons of clarity, I describe only the mutation. input MultilingualDescriptionInput { en: String! de: String! } input PutAppInput { name: String! description: MultilingualDescriptionInput! } type Mutation { createApp(input: PutAppInput!): App } In the request mapping template I use the utility helpers of AWS AppSync. ... { "version" : "2018-05-29", "operation" : "PutItem", "key" : { "id" : $util.dynamodb.toDynamoDBJson($ctx.args.input.name.replace(" ", "-").toLowerCase())) }, "attributeValues" : $util.dynamodb.toMapValuesJson($ctx.args.input) }
🌐
npm
npmjs.com › package › dynamodb-json-schema
dynamodb-json-schema - npm
July 11, 2019 - > Generate dynamodb table schema from json schema. Latest version: 0.1.2, last published: 7 years ago. Start using dynamodb-json-schema in your project by running `npm i dynamodb-json-schema`. There are no other projects in the npm registry using dynamodb-json-schema.
      » npm install dynamodb-json-schema
    
Published   Jul 11, 2019
Version   0.1.2
Top answer
1 of 1
2

I ended up finding a solution to this. Effectively, what I've done is to generate the Marshmallow schema exclusively for translation from the DynamoDB into the Python objects. All Schema classes have @post_load methods that translate into the Python objects and all fields are labeled with the type they need to be in the Python world, not the database world.

When validating the input from the REST API and ensuring that no bad data is allowed to get into the database, I call MySchema().validate(input_json), check to see that there are no errors, and if not, dump the input_json into the database.

This leaves only one extra problem which is that the input_json needs to be cleaned up for entry into the Database, which I was previously doing with Marshmallow. However, this can also easily be done by adjusting my JSON decoder to read Decimals from floats.

So in summary, my JSON decoder is doing the work of recursively walking the data structure and converting Float to Decimal separately from Marshmallow. Marshmallow is running a validate on the fields of every object, but the results are only checked for errors. The original input is then dumped into the database.

I needed to add this line to do the conversion to Decimal.

app.json_decoder = partial(flask.json.JSONDecoder, parse_float=decimal.Decimal)

My create function now looks like this. Notice how the original input_json, parsed by my updated JSON decoder, is inserted directly into the database, rather than any data mundged output from Marshmallow.

@app.route("/machine/<uuid:machine_id>", methods=['POST'])
def create_machine(machine_id):
    input_json = request.get_json() # Already ready to be DB input as is.
    errors = MachineSchema().validate(input_json)
    if errors:
      return jsonify({"status": "failure",message = dumps(errors)})
    else:
      input_json['id'] = machine_id
      dynamodb.Table('machine').put_item(Item=input_json)
      return jsonify({"status", "success", error_message = ""})
🌐
DynamoDB
dynobase.dev › dynamodb-json-converter-tool
Convert JSON to DynamoDB JSON (& back) [Free Tool]
DynamoDB does not use the classical JSON format to store items internally. Instead, it uses a "marshalled" format. DynamoDB wraps all the attribute values in objects where the Key indicates its type and attribute value stays as-is.
Top answer
1 of 3
19

I just managed to do a complete dump and "restore" using bchew/dynamodump:

git clone [email protected]:bchew/dynamodump.git

Notice the --schemaOnly option in the documentation https://github.com/bchew/dynamodump. Command was:

./dynamodump.py -m backup --schemaOnly --region foo-region --host localhost --srcTable '*' --port 8000 --accessKey fooKey --secretKey barKey

Then you can use the -m restore mode to put the data or schema back into a local dynamodb or wherever desired :)

With that said, I still find it unbelievable how bad is the amazon dynamodb tool-chain. Come on guys.

2 of 3
6

This takes aws dynamodb describe-table output, and transforms it into the input-format of aws dynamodb create-table --cli-input-json:

AWS_PROFILE=xyz aws dynamodb describe-table --table-name MyTable > mytable_full.json

# Pull out just what is minimally needed for table-creation:
#
#  TableName
#  KeySchema
#  AttributeDefinitions (must only contain attributes used in keys)
#  Global/Local Secondary Indexes
#  Defaults BillingMode to PAY_PER_REQUEST
#   (any provisioning can be set up manually based on load)

jq <mytable_full.json '.Table | {TableName, KeySchema, AttributeDefinitions} + (try {LocalSecondaryIndexes: [ .LocalSecondaryIndexes[] | {IndexName, KeySchema, Projection} ]} // {}) + (try {GlobalSecondaryIndexes: [ .GlobalSecondaryIndexes[] | {IndexName, KeySchema, Projection} ]} // {}) + {BillingMode: "PAY_PER_REQUEST"}' ​>mytable.json

AWS_PROFILE=xyz aws dynamodb create-table --cli-input-json file://mytable.json

You can also paste the json into python (the python dict syntax closely matches json) eg

import boto3

dynamodb = boto3.resource("dynamodb")

tabledef = {
    "TableName": "MyTable",
    "KeySchema": [
...
}

table = dynamodb.create_table(**tabledef)
print("Table status: ", table.table_status)

References:

https://docs.aws.amazon.com/cli/latest/reference/dynamodb/describe-table.html https://docs.aws.amazon.com/cli/latest/reference/dynamodb/create-table.html https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_CreateTable.html https://boto3.amazonaws.com/v1/documentation/api/latest/guide/dynamodb.html#creating-a-new-table

🌐
Airbyte
discuss.airbyte.io › connector development
[Source DynamoDB] Defining JSON Schema for NoSQL databases - Connector Development - Airbyte
July 9, 2022 - I started working on a new connector source-dynamodb. (see the PR #14555) The way I’m thinking of developing the new connector is to add each listed table as a stream (detailed tables could be narrowed with a prefix que…
🌐
AWS Fundamentals
awsfundamentals.com › blog › aws-dynamodb-data-types
AWS DynamoDB Data Types
September 12, 2022 - Map - This is again a JSON document as an attribute. A common example is to have a subscription object in your user model.
🌐
Medium
anisulnz.medium.com › storing-json-data-in-dynamodb-using-aws-sdk-for-java-v2-a385cbc26f01
Storing JSON Data in DynamoDB Using AWS SDK for Java v2 | by Anisul Islam | Medium
May 21, 2024 - We will create custom attribute converters, set up a simple table schema, and illustrate the process step by step. DynamoDB stores data as attributes, but it does not natively support complex types like JSON. To store JSON data, we need to convert it to a format DynamoDB understands (a string, for instance). This is where attribute converters come in. We’ll create two attribute converters for our example classes Content and Location
🌐
Formkiq
docs.formkiq.com › platform architecture › dynamodb schema
DynamoDB Schema | FormKiQ
The Site Entity Schema stores the JSON schema configuration for a site-level entity.
🌐
Insightsoftware
documentation.insightsoftware.com › simba-dynamodb-jdbc-driver › content › jdbc › dy › features › schemadefn.htm
Schema Definition
To ensure consistent support for your DynamoDB data, you must configure the connector to use a schema definition from a JSON file or the database.