Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Push compressed data into DynamoDB using java

I have gone through the following doc which tells how to compress data before pushing into DynamoDB.

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

Is it possible to push data (> 1KB in size) in compressed format and rest of the data in uncompressed format into DynamoDB?

My Scenario: Push JSON string into DynamoDB

  1. Check if JSON object size is more than 1KB.
  2. If yes, compress the JSON string and update into DynamoDB
  3. If no, update the JSON string as it is into DynamoDB
like image 899
Inaccessible Avatar asked Dec 07 '25 11:12

Inaccessible


1 Answers

Compute the item size of your document recursively, as does the DynamoDB Storage Backend for Titan here. Then, if the item size is greater than 1kb you can choose to encode all or part of your document as a compressed binary.

like image 60
Alexander Patrikalakis Avatar answered Dec 09 '25 23:12

Alexander Patrikalakis