Bird
0
0

You have a DynamoDB table with TTL enabled on attribute 'expireAt'. You want to migrate data to a new table but keep expired items for 7 days before deletion. How can you implement this?

hard📝 Application Q9 of 15
AWS - DynamoDB
You have a DynamoDB table with TTL enabled on attribute 'expireAt'. You want to migrate data to a new table but keep expired items for 7 days before deletion. How can you implement this?
ASet TTL attribute to null and use a scheduled Lambda to delete after 7 days
BAdd 7 days to 'expireAt' timestamps during migration and enable TTL on new table
CDisable TTL on new table and manually delete expired items after 7 days
DUse DynamoDB Streams to delay deletion by 7 days
Step-by-Step Solution
Solution:
  1. Step 1: Understand TTL controls deletion timing

    TTL deletes items when current time passes the TTL timestamp.
  2. Step 2: Adjust TTL timestamps to delay deletion

    Adding 7 days to 'expireAt' delays deletion by 7 days.
  3. Step 3: Enable TTL on new table with updated timestamps

    This ensures automatic deletion after the desired delay.
  4. Final Answer:

    Add 7 days to 'expireAt' timestamps during migration and enable TTL on new table -> Option B
  5. Quick Check:

    Delay deletion by adjusting TTL timestamps [OK]
Quick Trick: Shift TTL timestamps forward to delay expiration [OK]
Common Mistakes:
  • Disabling TTL and relying on manual deletion
  • Setting TTL attribute to null disables expiry
  • Expecting Streams to delay deletion

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes