DBS-C01 Workload-Specific Database Design Practice Question
A company uses Amazon DynamoDB for a time-series IoT workload. Each device sends a data point every minute. The primary key consists of device_id (partition key) and timestamp (sort key). The company wants to efficiently retrieve the latest 10 data points for a specific device. Which query design is most efficient?
⚠ Common exam trap
It's easy for candidates to confuse ScanIndexForward=true with 'latest' results, or incorrectly assume GetItem can retrieve the maximum sort key without knowing its value, leading them to choose inefficient options like scanning or reversing an ascending query.
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
✓
Query the table with ScanIndexForward=false and Limit=10.
Query with ScanIndexForward=false retrieves items in descending order by the sort key (timestamp), and Limit=10 stops after the first 10 items, which are the most recent 10 data points for the given device_id. This is the most efficient design as it reads only the 10 items needed, leveraging the DynamoDB local secondary index or table's sort key order without any post-processing.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use GetItem on the device_id partition key with the maximum timestamp.
Why it's wrong here
GetItem requires both partition and sort key; you cannot get multiple items.
- ✗
Query the table with ScanIndexForward=true and Limit=10, then reverse the result set.
Why it's wrong here
This returns the oldest 10 items; you would need to scan more to get the latest.
- ✓
Query the table with ScanIndexForward=false and Limit=10.
Why this is correct
This returns the most recent 10 items in descending order by timestamp.
- ✗
Scan the entire table and filter by device_id, then sort by timestamp.
Why it's wrong here
Full table scan is inefficient and costly.
Go deeper
Related to this question
About these practice questions
Courseiva writes every DBS-C01 question from scratch — 1,663 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. 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.