
Ultimate access to all questions.
In a mobile app using Amazon DynamoDB to store blog posts, with millions added daily, identify the most cost-effective method to automatically delete posts older than 48 hours.
A
Add a timestamp attribute to each item, indicating creation time. Develop a script for a table scan to identify and remove posts older than 48 hours using BatchWriteItem. Schedule execution hourly on an EC2 instance.
B
Introduce a timestamp attribute for creation time in each item. Develop a script for a table scan to identify and remove posts older than 48 hours using BatchWriteItem. Containerize the script and run it every 5 minutes on AWS Fargate via ECS.
C
Add a Date type attribute to each item, set to 48 hours post-creation. Create a GSI using this attribute as a sort key. Develop a Lambda function to reference the GSI and remove expired items with BatchWriteItem, triggered every minute by a CloudWatch event.
D
Add a Number type attribute to each item, set to the expiration time 48 hours post-creation. Enable DynamoDB's TTL feature using this attribute to automatically delete expired items.