Reputation: 37
{
"vendor_id": "jack123xx",
"book_list": [
{
"category": "crime",
"price" : "100$",
"book_id": "1234A",
"name": "human_body"
},
{
"category": "romantic",
"book_id": "1234B",
"name": "trash",
"price" : "121$",
}
]
}
i want to store the above data in a dynamodb table,frequently retrieve and update the price of books based on book_id and vendor_id ,which is the best way to organise these data in aws dynamodb.
Upvotes: 0
Views: 89
Reputation: 2996
You can use vendor_id as the PartitionKey and book_id as the SortKey.
Using this approach you achieve all of your requirements like:
Also check DynamoDB LSI and GSI features that will help you to accommodating future requirements.
Upvotes: 2