0
0
DynamoDBquery~20 mins

TTL with Streams for archival in DynamoDB - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
TTL Streams Archival Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
query_result
intermediate
2:00remaining
What happens when an item expires with TTL enabled in DynamoDB?

Consider a DynamoDB table with TTL enabled on the attribute expiryTimestamp. What is the expected behavior when an item's TTL expires?

AThe item is immediately deleted and a stream record of type REMOVE is generated.
BThe item remains in the table until manually deleted; no stream record is generated.
CThe item is archived automatically to S3 and removed from the table instantly.
DThe item is deleted asynchronously after expiration and a stream record of type REMOVE is generated.
Attempts:
2 left
💡 Hint

TTL deletion is not immediate but happens asynchronously by DynamoDB.

🧠 Conceptual
intermediate
1:30remaining
Why use DynamoDB Streams with TTL for archival?

What is the main reason to enable DynamoDB Streams when using TTL for archival purposes?

ATo speed up the TTL deletion process by triggering immediate deletes.
BTo capture expired item deletions so they can be archived elsewhere before removal.
CTo prevent expired items from being deleted automatically.
DTo automatically backup the entire table every time TTL deletes an item.
Attempts:
2 left
💡 Hint

Think about how you can keep a copy of deleted items.

📝 Syntax
advanced
1:00remaining
Which DynamoDB Stream event type corresponds to TTL deletion?

Given a DynamoDB Stream event record, which eventName indicates an item was deleted due to TTL expiration?

A"REMOVE"
B"INSERT"
C"MODIFY"
D"EXPIRE"
Attempts:
2 left
💡 Hint

TTL deletions remove items from the table.

🔧 Debug
advanced
2:30remaining
Why is no stream record generated for expired items?

You enabled TTL and DynamoDB Streams on your table, but you notice no REMOVE events appear in the stream when items expire. What could be the cause?

ATTL deletions happen asynchronously and may take up to 48 hours to process, so no immediate stream events appear.
BStreams do not capture TTL deletions by design.
CThe TTL attribute is not set as a Number type, so TTL is ignored and no deletions occur.
DThe stream is configured to capture only INSERT events, so REMOVE events are filtered out.
Attempts:
2 left
💡 Hint

TTL deletions are asynchronous and can take up to 48 hours to appear in streams.

optimization
expert
3:00remaining
Best practice for archiving expired DynamoDB items using TTL and Streams

You want to archive expired items from a DynamoDB table to S3 using TTL and Streams. Which approach optimizes cost and reliability?

AEnable TTL and Streams, but archive items directly from the stream without batching or retries.
BDisable TTL, and use Streams to capture all INSERT and MODIFY events, then archive items after a fixed time.
CEnable TTL and Streams, use a Lambda triggered by REMOVE events to batch and write expired items to S3 asynchronously.
DEnable TTL only, and run a scheduled job to scan the table for expired items and archive them manually.
Attempts:
2 left
💡 Hint

Think about asynchronous processing and batching for cost efficiency.