0
0
DynamoDBquery~20 mins

TTL attribute setup in DynamoDB - 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!
🧠 Conceptual
intermediate
1:00remaining
Understanding TTL attribute purpose
What is the main purpose of setting a TTL (Time To Live) attribute on a DynamoDB table item?
ATo automatically delete items after a specified time to reduce storage costs
BTo encrypt the item data for security purposes
CTo create a backup of the item before deletion
DTo increase the read capacity of the table temporarily
Attempts:
2 left
💡 Hint
Think about why you would want items to disappear automatically.
query_result
intermediate
1:00remaining
TTL attribute data type and value
Which of the following is the correct data type and value format for a TTL attribute in DynamoDB?
AA boolean value indicating if the item should expire
BA string representing a date in ISO 8601 format, e.g., "2024-06-01T12:00:00Z"
CA number representing the Unix epoch time in seconds when the item expires
DA map containing the expiration date and time
Attempts:
2 left
💡 Hint
TTL uses a timestamp in seconds since 1970-01-01.
📝 Syntax
advanced
1:30remaining
Enabling TTL on a DynamoDB table
Which AWS CLI command correctly enables TTL on a DynamoDB table with the TTL attribute named 'expireAt'?
Aaws dynamodb update-table --table-name MyTable --ttl Enabled expireAt
Baws dynamodb update-time-to-live --table-name MyTable --time-to-live-specification Enabled=true,AttributeName=expireAt
Caws dynamodb set-ttl --table-name MyTable --ttl-attribute expireAt --enable
Daws dynamodb enable-ttl --table MyTable --attribute expireAt
Attempts:
2 left
💡 Hint
Check the official AWS CLI command syntax for TTL update.
optimization
advanced
1:30remaining
Optimizing TTL attribute usage
To optimize the TTL feature and avoid unexpected data retention, which practice is recommended when setting the TTL attribute value?
ASet the TTL attribute to the current time to delete items immediately
BDo not set the TTL attribute; rely on manual deletion instead
CSet the TTL attribute to a timestamp far in the past to trigger instant deletion
DSet the TTL attribute to a timestamp at least 24 hours in the future to allow for processing delays
Attempts:
2 left
💡 Hint
TTL deletion is not immediate; allow some buffer time.
🔧 Debug
expert
2:00remaining
Troubleshooting TTL not deleting expired items
You enabled TTL on your DynamoDB table with attribute 'expireAt', but expired items are not being deleted after several days. What is the most likely cause?
AThe TTL attribute values are stored as strings instead of numbers
BThe table's read capacity is too low to process TTL deletions
CThe TTL attribute name is misspelled in the update-time-to-live command
DDynamoDB does not support TTL on tables with global secondary indexes
Attempts:
2 left
💡 Hint
TTL attribute must be a number, not a string.