Q29 — AWS DVA-C02 Ch.1
Question 29 of 100 | ← Chapter 1
A company runs its website on AWS. The company publishes polls daily and releases poll results the following day. The website stores user responses in an Amazon DynamoDB table. After releasing poll results, the company no longer needs to retain user responses. A developer must implement a solution that automatically deletes old user responses from the DynamoDB table. The developer has added a new expiration_date attribute to the DynamoDB table and plans to use it for automation. Which solution meets these requirements with the least development effort?
- A. Create an AWS Lambda function that deletes old user responses based on the expiration_date attribute. Create an Amazon EventBridge schedule to invoke the Lambda function daily.
- B. Create an AWS Fargate task in Amazon Elastic Container Service (Amazon ECS) that deletes old user responses based on the expiration_date attribute. Create an Amazon EventBridge schedule to run the Fargate task daily.
- C. Create an AWS Glue job that deletes old user responses based on the expiration_date attribute. Create an AWS Glue trigger schedule to run the job daily.
- D. Enable Time-to-Live (TTL) on the DynamoDB table and specify the expiration_date attribute. Use DynamoDB TTL to expire and delete old user responses. ✓
Correct Answer: D. Enable Time-to-Live (TTL) on the DynamoDB table and specify the expiration_date attribute. Use DynamoDB TTL to expire and delete old user responses.
Explanation
Enabling DynamoDB TTL and specifying the expiration_date attribute is the simplest solution. DynamoDB automatically expires and deletes items with expired timestamps without requiring custom code or additional AWS services—minimizing development effort while meeting the requirement.