Actually, the approach depends on the Query Access Pattern (QAP).

Approach 1:-

  1. Typical, normalized approach similar to RDBMS design. However, we need to think this on NoSQL perspective. There is no join in DynamoDB. Potentially, you may need to read two tables to get the required data. Please note that cost is calculated based on Read Capacity Units. So, the two different reads will cost you.

  2. This approach may be acceptable if the item size exceeds the DynamoDB item size 400 KB

  3. You can write query expression to filter the data by attributes attrX, attrY and attrZ as they are stored as normal scalar data type attributes

Approach 2:-

  1. Preferred NoSQL approach to keep all the required data in one table. Join or additional read is not required

  2. Need to consider whether the item size can exceed 400 KB

  3. Whether you need to write query to filter the data by attributes attrX, attrY and attrZ. Please note that in this approach the ListC data is stored as List of Map DynamoDB data type. In most scenarios, DynamoDB doesn't have the flexibility to query the complex data structures like this (i.e. Map inside List data type)

List of Objects - means List of Map on DynamoDB database

{ X: "2.8", Y: "nop" } - is the object. This translates to MAP data type on DynamoDB database.

The outside square bracket translates to LIST data type on DynamoDB

Answer from notionquest on Stack Overflow
🌐
AWS
docs.aws.amazon.com › amazon dynamodb › developer guide › programming with dynamodb and the aws sdks › overview of aws sdk support for dynamodb › higher-level programming interfaces for dynamodb › java 1.x: dynamodbmapper › mapping arbitrary data in dynamodb
Mapping arbitrary data in DynamoDB - Amazon DynamoDB
The converter code transforms data when objects are saved or loaded. It is also used for all operations that consume complex types. Note that when comparing data during query and scan operations, the comparisons are made against the data stored in DynamoDB. For example, consider the following CatalogItem class that defines a property, Dimension, that is of ...
🌐
Anatomy of an Item
dynamodbguide.com › anatomy of an item
Anatomy of an Item | DynamoDB, explained.
January 1, 2018 - For a Map attribute, these values are stored in key-value pairs, similar to the map or dictionary objects in most programming languages. Also like the List type, you can operate directly on map elements using expressions.
Discussions

database - DynamoDB: How to store a list of items - Stack Overflow
Please note that in this approach the ListC data is stored as List of Map DynamoDB data type. In most scenarios, DynamoDB doesn't have the flexibility to query the complex data structures like this (i.e. Map inside List data type) List of Objects - means List of Map on DynamoDB database More on stackoverflow.com
🌐 stackoverflow.com
java - Storing and searching maps in DynamoDB? - Stack Overflow
DynamoDB records are literally ... store and search maps in DynamoDB. It looks like if your map isn't of then you need to provide a custom converter. You wouldn't convert the entire map to a string, you would convert the map to a Map ... Sign up to request clarification or add additional context in comments. ... Another thing you could consider is @DynamoDBDocument. Basically it means instead of using a map you are using an object (but translates ... More on stackoverflow.com
🌐 stackoverflow.com
java - DynamoDB Storing/ Mapping Complex Objects in Maps - Stack Overflow
Get early access and see previews of new features. Learn more about Labs ... We are trying to get started with dynamo db and I'm breaking my head over a mapping problem. I have a model Match and matchPlayer. Match has a map property which contains matchPlayer objects. I can't get dynamodb to ... More on stackoverflow.com
🌐 stackoverflow.com
February 3, 2016
java - Storing JSON as string in DynamoDB vs List/Map types - Stack Overflow
Bring the best of human thought and AI automation together at your work. Explore Stack Internal ... I am using DynamoDB for storage. I need to store a Java object in one attribute within a table. I see two approaches: One to convert the object to JSON using Jackson on the client side, and then store the JSON string in the attribute. Another way is to use DynamoDB List/Map ... More on stackoverflow.com
🌐 stackoverflow.com
🌐
DZone
dzone.com › data engineering › databases › map dynamodb items to objects using dynamodbmapper
Map DynamoDB Items to Objects Using DynamoDBMapper
September 22, 2016 - We will try to map the Users, Logins, Supervisors, and companies tables from the previous example. Users is a simple table using the users email as a Hash key. package com.gkatzioura.dynamodb.mapper.entities; import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBAttribute; import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBHashKey; import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBTable; /** * Created by gkatzioura on 9/20/16.
🌐
GitHub
github.com › Medium › dynamite › pull › 92 › files
Convert objects to DynamoDB Maps for storage by danielpanzella · Pull Request #92 · Medium/dynamite
Looks like the code for reading maps from DynamoDB was added recently, but it fails when storing nested objects. This seems to make it work for me.
Author   Medium
Find elsewhere
🌐
Slawomirstec
slawomirstec.com › blog › 2021 › 02 › dynamodb-json
Storing JSON as a map attribute in the DynamoDB - AWS and serverless
Please note, this is testing code only, however, allowed me to save automatically my client objects without maintaining any mappings. Additionally, I've defined a strategy for storing entities with MapAttribute column, each row in DynamoDb consist of three columns, PK (prefix + unique client id), SK (prefix + entity id), client_model_json (MapAttribute).
🌐
GitHub
github.com › aws › aws-sdk-java-v2 › issues › 1902
DDB Enhanced: Support arbitrary map fields · Issue #1902 · aws/aws-sdk-java-v2
June 17, 2020 - Create a mapper for Objects, and use instanceof to determine the type converter. JSON-encoding the data and store as string, but using this approach I would sacrifice searchability of the nested attributes.
Author   aws
🌐
AWS
docs.aws.amazon.com › amazon dynamodb › developer guide › programming with dynamodb and the aws sdks › overview of aws sdk support for dynamodb › higher-level programming interfaces for dynamodb › java 1.x: dynamodbmapper
Java 1.x: DynamoDBMapper - Amazon DynamoDB
It will and its end-of-support is due on December 31, 2025. For new development, we highly recommend that you use 2.x. The AWS SDK for Java provides a DynamoDBMapper class, allowing you to map your client-side classes to Amazon DynamoDB tables. To use DynamoDBMapper, you define the relationship between items in a DynamoDB table and their corresponding object ...
🌐
GitHub
github.com › n8n-io › n8n › issues › 4514
DyanamoDb node should natively store object maps · Issue #4514 · n8n-io/n8n
November 2, 2022 - AWS DynamoDb node cannot store objects since it incorrectly formats object input data. The reason is that objects cannot be converted to strings using toString and instead should use JSON.stringify or similar in that case. The faulty lin...
Author   n8n-io
🌐
Javadoc.io
javadoc.io › static › software.amazon.awssdk › dynamodb-enhanced › 2.14.11 › software › amazon › awssdk › enhanced › dynamodb › internal › converter › attribute › MapAttributeConverter.html
MapAttributeConverter (AWS Java SDK :: DynamoDB :: Enhanced Client 2.14.11 API)
@ThreadSafe @Immutable public class MapAttributeConverter<T extends Map<?,?>> extends Object implements AttributeConverter<T> A converter between a specific Map type and AttributeValue. This stores values in DynamoDB as a map from string to attribute value.
🌐
DynamoDB
dynobase.dev › dynamodb-faq › how-do-you-store-json-on-dynamodb
[Answered] How do you store JSON on DynamoDB?
You can also use the DynamoDBMapper class of the AWS SDK for Java to map your Java objects directly to items in a DynamoDB table. The mapper supports both annotation-based and programmatic configuration and can automatically handle the serialization ...
🌐
AWS
docs.aws.amazon.com › amazon dynamodb › developer guide › amazon dynamodb: how it works › supported data types and naming rules in amazon dynamodb
Supported data types and naming rules in Amazon DynamoDB - Amazon DynamoDB
DynamoDB lets you work with individual ... information, see Using expressions in DynamoDB. A map type attribute can store an unordered collection of name-value pairs. Maps are enclosed in curly braces: { ... } A map is similar to a JSON object....
🌐
AWS
docs.aws.amazon.com › amazon dynamodb › developer guide › programming with dynamodb and the aws sdks › overview of aws sdk support for dynamodb › higher-level programming interfaces for dynamodb › working with the .net object persistence model and dynamodb › mapping arbitrary data with dynamodb using the aws sdk for .net object persistence model
Mapping arbitrary data with DynamoDB using the AWS SDK for .NET object persistence model - Amazon DynamoDB
In addition to the supported .NET ... direct mapping to the Amazon DynamoDB types. The object persistence model supports storing data of arbitrary types as long as you provide the converter to convert data from the arbitrary type to the DynamoDB type and vice versa. The converter code transforms data during both the saving and loading of the objects. You can create any types on the client-side. However the data stored in the tables ...
🌐
John Spong
jspong.github.io › 2021 › 07 › 19 › AbstractDynamoAttributes.html
Storing abstract and generic attributes in DynamoDB | John Spong
July 19, 2021 - Sometimes it’s not that simple and you want to have structured attributes that are modeled with custom object types. DynamoDB can store maps, but we don’t want to have to write our own code converting back-and-forth between Json maps and our Java objects.