How to Automatically Remove Old DynamoDB User Responses with Least Effort?

A company runs its website on AWS. The company posts daily polls on its website and publishes the poll results next day. The website stores user responses in an Amazon DynamoDB table. After the poll results are published, the company does not need to keep the user responses. A developer needs to implement a solution that will automatically remove old user responses from the DynamoDB table. The developer adds a new expiration_date attribute to the DynamoDB table. The developer plans to use the expiration_date attribute for the automation. Which solution will meet these requirements with the LEAST development effort?

  1. Create an AWS Lambda function to delete old user responses based on the expiration_date attribute. Create an Amazon EventBridge schedule to run the Lambda function daily.
  2. Create an AWS Fargate task in Amazon Elastic Container Service (Amazon ECS) to delete old user responses based on the expiration_date attribute. Create an Amazon EventBridge schedule to run the Fargate task daily.
  3. Create an AWS Glue job to delete old user responses based on the expiration_date attribute. Create an AWS Glue trigger schedule to run the job daily.
  4. Enable TTL on the DynamoDB table and specify the expiration_date attribute. Expire old user responses by using DynamoDB TTL. Source Reference Answer

Community Votes

D
100%

100% of anonymous learners picked answer D. Votes are pick records left by other test-takers — they are not the verified answer.

Community Insight

The question tests whether you recognize DynamoDB TTL as a native, serverless feature for item expiration; the trap is choosing a custom compute solution like Lambda that requires more development effort.

The correct answer is D: enabling DynamoDB TTL on the expiration_date attribute, which automatically expires old items without custom code. Community consensus strongly supports this as the least development effort solution.

Choosing A (Lambda + EventBridge) is common because developers often think of scheduled deletion jobs, but TTL is built-in, free, and requires no code or infrastructure management.

Community Discussion (6 comments)

albert_kuo 👍 1 Selected: D
1. enable ttl aws dynamodb update-time-to-live \ --table-name <your-table-name> \ --time-to-live-specification "Enabled=true, AttributeName=expiration_date" 2.Set TTL aws dynamodb describe-time-to-live --table-name <your-table-name>
tomchandler077 👍 1
To deploy an AWS Lambda function using AWS CloudFormation, especially when the function code is stored in an Amazon S3 bucket, the developer should reference the S3 location directly in the CloudFormation template. The best option to achieve this with the least development effort is: Option D directly links the Lambda function's deployment package stored in S3 to the CloudFormation template, which automates the deployment process without requiring additional steps for handling the function code.
65703c1 👍 1 Selected: D
D is the correct answer.
monishvster 👍 4 Selected: D
Always TTL
CrescentShared 👍 3 Selected: D
It's D.
Americo32 👍 1
Opção A

Comments & Corrections

No comments yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

Expert Analysis

Why the Answer Is Correct

Option D is correct because DynamoDB TTL is specifically designed to expire items automatically based on an attribute (expiration_date). It requires only enabling TTL with a CLI command or console setting, and DynamoDB handles deletion in the background, consuming no read/write capacity and incurring no extra cost. This is the true 'least development effort' approach compared to writing and maintaining custom code.

Why the Other Options Are Wrong

Options A, B, and C all require building and managing compute resources (Lambda, Fargate, or Glue), writing logic to query and delete items, and setting up schedules. They are over-engineered for a simple expiration requirement. Lambda (A) is serverless but still requires code and IAM roles; Fargate (B) requires container management; Glue (C) is a heavy ETL service designed for data transformation, not simple deletions. None offer the automatic, no-code efficiency of TTL.

Community Comment Notes

Comments strongly favor TTL: one comment (1) provides the exact AWS CLI command aws dynamodb update-time-to-live to enable TTL, showing its simplicity. Another comment (3) succinctly notes 'Always TTL', reinforcing that TTL is the go-to solution for expiring DynamoDB items. A third comment (4) simply states 'It's D', indicating community consensus. There was no significant support for alternatives.

Official Reference

Exam Strategy

When a question asks for 'least development effort' for expiring data in DynamoDB, immediately choose TTL. Only consider Lambda, ECS, or Glue if the question specifies constraints that TTL cannot satisfy, such as a complex deletion logic or a need to archive data before deletion.

Related Analysis

Practice All DVA-C02 Questions

Access 100 questions with complete answers and detailed explanations.

View Full DVA-C02 Practice Test →

← Back to DVA-C02 Study Guide