DVA-C02 · Question #422
A developer is creating an application that must transfer expired items from Amazon DynamoDB to Amazon S3. The developer sets up the DynamoDB table to automatically delete items after a specific…
The correct answer is B. Configure DynamoDB Streams to invoke an AWS Lambda function. Program the Lambda. DynamoDB Streams captures TTL-deleted items and can trigger Lambda to process and write them to S3, requiring no additional polling infrastructure.
Question
A developer is creating an application that must transfer expired items from Amazon DynamoDB to Amazon S3. The developer sets up the DynamoDB table to automatically delete items after a specific TTL. The application must process the items in DynamoDB and then must store the expired items in Amazon S3. The entire process, including item processing and storage in Amazon S3, will take 5 minutes. Which solution will meet these requirements with the LEAST operational overhead?
Options
- AConfigure DynamoDB Accelerator (DAX) to query for expired items based on the TTL. Save the
- BConfigure DynamoDB Streams to invoke an AWS Lambda function. Program the Lambda
- CDeploy a custom application on an Amazon Elastic Container Service (Amazon ECS) cluster on
- DCreate an Amazon EventBridge rule to invoke an AWS Lambda function. Program the Lambda
How the community answered
(62 responses)- A5% (3)
- B79% (49)
- C3% (2)
- D13% (8)
Why each option
DynamoDB Streams captures TTL-deleted items and can trigger Lambda to process and write them to S3, requiring no additional polling infrastructure.
DynamoDB Accelerator (DAX) is an in-memory read cache and does not emit events for TTL-expired items; it cannot be configured to query for deleted items.
When DynamoDB TTL deletes an item, DynamoDB Streams records the deletion event with the item's data. A Lambda function triggered by that stream can process the item and write it to S3 within the 5-minute window. This is fully managed and serverless, so there is no operational overhead of managing servers or schedulers.
Deploying a custom ECS cluster requires provisioning, scaling, and maintaining container infrastructure, which introduces significant operational overhead compared to a Lambda-based solution.
An EventBridge rule on a schedule would require the Lambda to query DynamoDB for recently expired items, adding complexity and potential timing gaps; it does not react to deletions as they happen.
Concept tested: DynamoDB Streams with Lambda for TTL-expired item processing
Source: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/time-to-live-ttl-streams.html
Community Discussion
No community discussion yet for this question.