DBS-C01 Workload-Specific Database Design Practice Question
A company is using Amazon DynamoDB to store session data for a web application. The session data expires after 24 hours. Which DynamoDB feature should the company use to automatically delete expired items?
⚠ Common exam trap
The trap here is that candidates may overcomplicate the solution by choosing a custom Lambda-based approach (Option D) or misidentifying Streams (Option C) as a deletion mechanism, when DynamoDB's native TTL feature is the simplest, most cost-effective, and fully managed answer.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
DynamoDB Time to Live (TTL)
DynamoDB Time to Live (TTL) is the correct choice because it provides a cost-effective, fully managed mechanism to automatically delete expired items based on a timestamp attribute in the table. TTL works by comparing the current time to the epoch time value stored in the designated TTL attribute; when the value is in the past, DynamoDB marks the item for deletion, typically within 48 hours. This eliminates the need for custom code or additional AWS services, directly addressing the requirement to remove session data after 24 hours.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
A retention policy on the DynamoDB table
Why it's wrong here
DynamoDB does not have a built-in retention policy.
- ✓
DynamoDB Time to Live (TTL)
Why this is correct
TTL automatically deletes expired items based on a timestamp attribute.
- ✗
DynamoDB Streams
Why it's wrong here
Streams capture changes but do not delete items.
- ✗
A scheduled AWS Lambda function that scans and deletes expired items
Why it's wrong here
A scheduled Lambda function that scans and entire DynamoDB table to delete expired items consumes read capacity for every item examined, even those not yet expired, and incurs additional cost and latency. This approach is tempting because Lambda is commonly used for custom cleanup tasks in databases lacking native TTL support, such as when a relational database requires a periodic purge script. However, DynamoDB’s native Time to Live (TTL) feature automatically deletes expired items without consuming read capacity or requiring external orchestration, making the Lambda scan unnecessary for this 24-hour expiry requirement.
Go deeper
Related to this question
About these practice questions
One of 1,663 original DBS-C01 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This DBS-C01 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DBS-C01 exam.