A website collects daily poll responses in a DynamoDB table and only needs to retain responses until the next day. The developer added an expiration_date attribute to each item. What is the simplest way to automatically remove expired responses from the table?
Choose an answer
Tap an option to check your answer.
Correct answer: Enable DynamoDB Time To Live (TTL) on the table and specify the expiration_date attribute..
Why this is the answer
Enabling DynamoDB Time To Live (TTL) on the table and specifying the expirationdate attribute is the simplest and most cost-effective solution. TTL automatically deletes items from the table after their expiration time, offloading the management of item deletion to DynamoDB. Creating a Lambda function, an AWS Fargate task, or an AWS Glue job to delete expired items would all work, but they are more complex and incur additional operational overhead and costs. These solutions require writing and maintaining code, setting up execution environments, and configuring schedules, whereas TTL is a built-in feature of DynamoDB designed for this exact use case.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed