Yogita Misal
Apr 21, 2024

--

How to store large 500 KB document into Dynamodb ?

  1. We can consider compressing the strings we save to DynamoDB.
  2. https://stacks.wellcomecollection.org/creating-a-data-store-from-s3-and-dynamodb-8bb9ecce8fc1
  3. You can compress the cast list data using compression algorithms such as gzip or deflate before storing it in DynamoDB. Here’s an example of how you can compress the cast list data using gzip compression in Node.js:
const zlib = require('zlib');

// Sample cast list data
const castList = ["Wayne Morris", "Priscilla Lane"];

// Convert the cast list to JSON string
const castListString = JSON.stringify(castList);

// Compress the cast list string using gzip
zlib.gzip(castListString, (err, compressedData) => {
if (err) {
console.error('Error compressing data:', err);
} else {
console.log('Compressed data:', compressedData.toString('base64'));
// Store the compressed data in DynamoDB
// You can use the compressedData.toString('base64') as the value for the attribute in DynamoDB
}
});

--

--

Yogita Misal
Yogita Misal

No responses yet