Is it a good idea to save an object in Amazon Dynamo as Json?

Looking at Amazon DynamoDB, I tried to figure out how to store complex objects that I create in my code and want to continue. I understand how I will store these objects in a relational database, such as MySql, but how to save them in DynamoDB?

I can think of one way ... turn them into Json and save the Json representation of the object in DynamoDB. To get them out of DynamoDB again, I would detach them from Json to my Object representation in my code.

Here is an example:

For this type of object: A car has an Engine that has many parts. Each part has a serial number, life cycle and replacement cost. Now I can turn the car into json, which will look something like this:

{
    "engine": {
        "parts": [
            {
                "serialNumber": "1234",
                "lifeSpan": 10,
                "replacementValue": 100
            },
            {
                "serialNumber": "5678",
                "lifeSpan": 1,
                "replacementValue": 200
            }
        ]
    }
}

Json "" "Key: CarName" Jaguar ", Value [above json]? ?

+6
5

, MySql, DynamoDB?

DynamoDB MySql: , (mysql) (dynamodb), , dynamodb 64 ( ).

Json "" : CarName "Jaguar", [ json]? ?

, , 64 .. json , - (, LSI GSI, updateItem) dynamodb, AWS.

dyngodb : dynamodb . , N .

+1

, - , .

, 400 . , , 1 .

, , 200 . 5 , , 1 . , , 5 , . 5 , , . . , .

JSON , .

+1

/stringset. , , , , . - ( php), php- .

0

- 400 .

http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html

, , .

AWS . , , cloudearch json- . , , S3 , .

, / , , . node/javascript, datatypes dynampdb , .

https://www.npmjs.com/package/dynamodb-data-types

0

All Articles