Is it a good idea to store an Object in Amazon Dynamo as Json?

You could try using an array of strings / stringset. That way you can push in more items one by one, unfortunately you can't request only one item, you need to get them all. Another option is a serialized array (if you are using php) that turns a nice php array into a string for storage in the DB.


I think storing objects is fine, as long as you don't overdo it.

Some other responses mention that the maximum size of an Item is 400KB. However, there is also a maximum size for the result of a fetch which is more problematic, since this limit is only 1MB.

So, let's say you plan to store huge documents, and end up consuming 200KB per Item. If you put more than 5 items in your database, then you are over the 1MB limit. That means, if you plan to do a query that needs to return more than 5 items, it won't work. You will only get 5 items, and you will have to perform a 2nd query to get the remaining items. You will need to consolidate those yourself. On top of that, it will be slow.

For small JSON messages that's not really an issue, and you shouldn't worry about it.


I understand how I would store these objects in a Relational Database like MySql but how would I store them in DynamoDB?

The mainstream solution for DynamoDB is pretty similar to the MySql one: you just, change a table row (mysql) with a table item (dynamodb), they both are flat structures, but a dynamodb item could have different attributes from other items in the table, and have a 64KB item size limit (column/attribute names included).

Should I just store the above Json in Dynamo as Key: CarName 'Jaguar', Value [above json] ? Or is there a better way to store the Car Object?

No, once your parts array grows you will face the 64KB item size limit. You can store a compressed version of the json to mitigate, but then you will not be able to use any attribute feature (eg. LSI or GSI, updateItem) in dynamodb, nor integrate seamlessly with other AWS products.

You can take a look at the way dyngodb stores those objects, shortly: one dynamodb item, for every object. One hash for arrays, with N ranges for the array elements.