A DynamoDB table has Time to Live (TTL) enabled.
A solution for processing items deleted by TTL needs to be implemented.
What is the optimal solution to this requirement?
Click on the arrows to vote for the correct answer
A. B. C. D.Answer: B.
Option A is incorrect because this solution would require creating a new DynamoDB table and restoring the DynamoDB table from backup to process the deleted records.
It is not the optimal solution.
Option B is CORRECT because DynamoDB Streams can be used to collect and retain items deleted by TTL.
Option C is incorrect because CloudWatch Events does not collect events from DynamoDB.Option D is incorrect because CloudTrail does not collect items deleted by TTL.
It only records log events performed on the DynamoDB service.
Reference:
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/time-to-live-ttl-streams.htmlThe optimal solution to process items deleted by TTL in a DynamoDB table is to enable DynamoDB Streams on the table.
DynamoDB Streams captures a time-ordered sequence of item-level modifications in a DynamoDB table, including item-level deletes. When TTL deletes an item, it generates a stream record that contains information about the deletion. These stream records can be processed by AWS Lambda or other AWS services.
Here are the reasons why the other options are not the optimal solution:
A. Continuous backups with point-in-time recovery for the table only protect against accidental data loss. They do not provide a way to process deleted items due to TTL.
B. Enabling DynamoDB Streams is the optimal solution to process deleted items due to TTL.
C. Using CloudWatch Events to collect TTL delete events and creating a Lambda function to process the event is another way to process deleted items due to TTL, but it is not the optimal solution. This approach requires more setup and management compared to using DynamoDB Streams.
D. Using CloudTrail to collect TTL delete events and creating an SNS Topic to trigger a Lambda function is not the optimal solution. CloudTrail does not capture TTL delete events. It only captures management events in DynamoDB, such as table creation and deletion.