0
0
AWScloud~20 mins

Time to live (TTL) for expiration in AWS - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
TTL Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
service_behavior
intermediate
2:00remaining
How does TTL affect item expiration in DynamoDB?

In AWS DynamoDB, when you enable TTL on a table, what happens to items after their TTL timestamp passes?

AItems become inaccessible but remain in the table until manually deleted.
BItems are marked for expiration and typically deleted within 48 hours after the TTL timestamp.
CItems are archived automatically to S3 when TTL expires.
DItems are immediately deleted from the table as soon as the TTL timestamp is reached.
Attempts:
2 left
💡 Hint

Think about how AWS handles background cleanup for expired items.

Configuration
intermediate
2:00remaining
Which DynamoDB attribute type is required for TTL?

When configuring TTL on a DynamoDB table, which attribute type must the TTL attribute have?

ANumber representing Unix epoch time in seconds.
BBoolean indicating if the item should expire.
CBinary data representing a timestamp.
DString representing a date in ISO 8601 format.
Attempts:
2 left
💡 Hint

TTL expects a timestamp in a numeric format.

security
advanced
2:00remaining
What IAM permission is required to enable TTL on a DynamoDB table?

To enable TTL on a DynamoDB table using AWS IAM, which permission must be granted?

Adynamodb:UpdateTimeToLive
Bdynamodb:EnableTTL
Cdynamodb:ModifyTableTTL
Ddynamodb:SetTTLAttribute
Attempts:
2 left
💡 Hint

Check the exact IAM action name for TTL updates.

Architecture
advanced
2:00remaining
How does TTL impact read capacity and storage costs in DynamoDB?

Consider a DynamoDB table with TTL enabled. How does TTL affect read capacity units (RCUs) and storage costs over time?

ATTL reduces both storage costs and RCUs immediately after expiration.
BTTL increases RCUs because it triggers additional read operations for expired items.
CTTL reduces storage costs by deleting expired items, but does not reduce RCUs since expired items are still read until deleted.
DTTL has no effect on storage costs or RCUs.
Attempts:
2 left
💡 Hint

Think about when items are actually removed and how reads behave before deletion.

Best Practice
expert
2:00remaining
What is the recommended approach to handle TTL attribute updates for item renewal?

You want to extend the life of an item in a DynamoDB table with TTL enabled by updating its expiration time. What is the best practice to update the TTL attribute?

ADelete the item and recreate it with a new TTL attribute value.
BLeave the TTL attribute unchanged; DynamoDB automatically extends TTL on item access.
CSet the TTL attribute to null to disable expiration, then set it again to a new timestamp.
DUpdate the TTL attribute with a new future Unix epoch time using an atomic update operation.
Attempts:
2 left
💡 Hint

Consider how to safely change the expiration time without losing the item.