Q50 — AWS DVA-C02 Ch.2

Question 50 of 100 | ← Chapter 2

A developer supports an application that accesses data in an Amazon DynamoDB table. One of the item attributes is expirationDate, formatted as a timestamp. The application uses a scheduled job to scan the table, retrieve items with expired timestamps, and delete them. The application is being deprecated, and the developer must adopt an alternative implementation for this functionality. The developer needs a solution requiring the least amount of custom code. Which solution meets these requirements?

Correct Answer: A. Enable TTL on the expirationDate attribute in the table. Create a DynamoDB stream. Create an AWS Lambda function to process deleted items. Configure a DynamoDB trigger for the Lambda function.

Explanation

Option A recommends enabling Time-to-Live (TTL) on the expirationDate attribute, which automatically deletes expired items. By creating a DynamoDB stream and an AWS Lambda function to process deleted items—and configuring a DynamoDB trigger to invoke the function—the developer can automatically handle deleted items with minimal custom logic. TTL handles expiration natively, and only one Lambda function is required to process deletions. In contrast, other options involve more manual orchestration and additional code. Thus, Option A is the most code-efficient solution. 【Lantern Certification provided by: swufelp1999】