How to Store Large Attribute Values in DynamoDB

  • Any item cannot exceed 400 KB in size.
  • Query and Scan operations are limited to 1 MB of data scanned (After that, you will be forced to paginate).

1. Writes

$ node write.js
Generated a text with 12973 characters and 1943 words
total size (uncompressed): ~13 KB
total size (compressed): ~4 KB
Write capacity for compressed post { TableName: 'blog', CapacityUnits: 4 }
Write capacity for raw post { TableName: 'blog', CapacityUnits: 14 }

2. Reads

$ node read.js
Read capacity for compressed post { TableName: 'blog', CapacityUnits: 0.5 }
Original text with 12973 characters and 1943 words
Read capacity for raw post { TableName: 'blog', CapacityUnits: 2 }

3. Secondary indexes

$ node write.js
Generated a text with 13673 characters and 1986 words
total size (uncompressed): ~13 KB
total size (compressed): ~4 KB
Write capacity for compressed post {
TableName: 'blog',
CapacityUnits: 12,
Table: { CapacityUnits: 4 },
GlobalSecondaryIndexes: { timestamp: { CapacityUnits: 8 } }
}
Write capacity for raw post {
TableName: 'blog',
CapacityUnits: 42,
Table: { CapacityUnits: 14 },
GlobalSecondaryIndexes: { timestamp: { CapacityUnits: 28 } }
}

Conclusion

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Benoît Bouré

Benoît Bouré

Twitter @Benoit_Boure — Need help? Hire me for a one-on-one session http://hiretheauthor.com/bboure