A company caches session information for a web application in an Amazon DynamoDB table. The company wants an automated way to delete old items from the table.
What is the simplest way to do this?
A.
Write a script that deletes old records; schedule the script as a cron job on an Amazon EC2 instance.
B.
Add an attribute with the expiration time; enable the Time To Live feature based on that attribute.
C.
Each day, create a new table to hold session data; delete the previous day's table.
D.
Add an attribute with the expiration time; name the attribute ItemExpiration.
The simplest way to automatically delete old items from an Amazon DynamoDB table is to use DynamoDB's Time to Live (TTL) feature. This feature allows you to define an attribute that stores the expiration time for each item. Once the specified time has passed, DynamoDB automatically deletes the expired items, freeing up storage and reducing costs without the need for custom scripts or manual intervention.
A) Eliminated - no automation
C) Eliminated - Constantly creating and deleting tables is not practical and can lead to management and scaling issues.
D) Eliminated - Without enabling TTL, merely adding the attribute does not automate item deletion.
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Dushank
Highly Voted 1 year, 1 month agosumanshu
Most Recent 4 months ago65703c1
5 months, 1 week agocatcatpunch
1 year, 5 months agozodraz
1 year, 5 months ago