Bird
0
0

You want to automatically remove expired items from a DynamoDB table and also trigger a notification when deletion happens. How can you achieve this?

hard📝 Best Practice Q8 of 15
AWS - DynamoDB
You want to automatically remove expired items from a DynamoDB table and also trigger a notification when deletion happens. How can you achieve this?
AEnable TTL and configure CloudWatch alarms on the table
BEnable TTL and configure SNS directly on the table
CEnable TTL on the table and use DynamoDB Streams to trigger a Lambda function for notifications
DUse a scheduled Lambda to scan and delete expired items and send notifications
Step-by-Step Solution
Solution:
  1. Step 1: Use TTL for automatic deletion

    Enable TTL to let DynamoDB delete expired items automatically.
  2. Step 2: Use DynamoDB Streams to detect deletions

    DynamoDB Streams capture item deletions, which can trigger Lambda functions.
  3. Step 3: Lambda sends notifications

    Lambda can send notifications (e.g., via SNS) when deletions occur.
  4. Final Answer:

    Enable TTL on the table and use DynamoDB Streams to trigger a Lambda function for notifications -> Option C
  5. Quick Check:

    TTL + Streams + Lambda = auto delete + notify [OK]
Quick Trick: Combine TTL with Streams and Lambda for notifications [OK]
Common Mistakes:
MISTAKES
  • Expecting SNS directly on table without Streams
  • Using scheduled Lambda instead of TTL
  • Relying on CloudWatch alarms for deletions

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes