Storing Large Strings with AWS Services for DynamoDB Table

Recommended Option for Storing Large Strings in DynamoDB

Prev Question Next Question

Question

You are working on an application that saves strings in the DynamoDB table.

For strings with a size more than 400KB, you are getting an item size exceeded error.

Which of the following is a recommended option to store strings with a larger size using AWS services?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Correct Answer - C.

Amazon S3 can be used to saved items which are exceeding 400 KB.

In this option, Items are saved in S3 buckets while an object identifier is saved in the DynamoDB table which points to an item in S3.

Option A is incorrect.

Compressing large-size strings to fit in the DynamoDB table can be used to resolve this error.

Still, it will be a short-term solution & not a recommended option for permanently resolving item size error.

Option B is incorrect.

Splitting strings in multiple tables will incur inconsistency while updating items in multiple tables, & also this will not be a permanent resolution.

Option D is incorrect as the Item size of 400 KB is a hard limit & cannot be expanded.

For more information on using S3 with DynamoDB for saving larger files, refer to the following URL-

ttps://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-use-s3-too.html.

The correct option to store strings with a size larger than 400KB using AWS services is option C - Save string object in S3 with object identifiers in DynamoDB.

DynamoDB is a NoSQL database service provided by AWS, which is optimized for fast and predictable performance with seamless scalability. However, it has a limit on the item size which is 400KB, and items larger than this size are not supported.

Option A, compressing large size strings, may not be a feasible option as it will require decompression every time the string is read from the table, which could lead to performance issues.

Option B, splitting strings between multiple tables, is also not recommended as it can add complexity to the application design and querying data across multiple tables can be challenging.

Option D, opening a ticket with AWS support to increase the item size, is not feasible as item size limit is a hard limit, and AWS cannot increase this limit.

Option C, saving the string object in S3 with object identifiers in DynamoDB, is the recommended option. With this option, the application can store the large strings in an S3 bucket, which can handle objects with a size of up to 5TB. The object identifiers of the stored strings can be stored in the DynamoDB table, and the application can retrieve the string object by reading the object identifier from DynamoDB and retrieving the object from S3.

Therefore, option C provides a scalable and efficient solution to store large strings in DynamoDB without violating the item size limit.