AWS Certified Data Engineer Associate DEA-C01 Practice Question
An IoT company ingests millions of sensor records into Amazon DynamoDB. Each item includes deviceId, readingType, timestamp (ISO 8601), and value. Engineers must quickly retrieve the last 24 hours of readings for a single device and occasionally list the most recent readings for a given readingType across all devices. Which table design meets these access patterns with the least read cost?
Create one table with partition key readingType and sort key deviceId; add a GSI with deviceId as the partition key only.
Create a separate DynamoDB table for each day (yyyy-mm-dd) with partition key deviceId and no secondary indexes.
Create one table with partition key deviceId and sort key timestamp; enable TTL on the timestamp attribute; add a GSI with readingType as the partition key and timestamp as the sort key.
Create one table with partition key deviceId and sort key readingType; filter the timestamp range in application code when querying.
The most efficient design stores all readings for the same device in one partition and sorts them by timestamp. A query that specifies the deviceId and a timestamp condition can retrieve the last 24 hours without scanning other partitions. A global secondary index with readingType as the partition key and timestamp as the sort key supports lookups for a reading type across all devices. Adding a TTL attribute based on timestamp automatically removes stale data, keeping partitions small and lowering read costs. Designs that put readingType in the base table's key, omit an index, or create many daily tables either force application-side filtering or require multiple queries, resulting in higher read cost and operational overhead.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
Why is a GSI (Global Secondary Index) needed in this design?
Open an interactive chat with Bash
What is TTL (Time to Live) and how does it help in this scenario?
Open an interactive chat with Bash
Why is using deviceId as the partition key and timestamp as the sort key optimal for querying?
Open an interactive chat with Bash
What is TTL in DynamoDB?
Open an interactive chat with Bash
What is a GSI and how does it work in DynamoDB?
Open an interactive chat with Bash
Why is deviceId the best choice for the primary partition key?
Open an interactive chat with Bash
AWS Certified Data Engineer Associate DEA-C01
Data Store Management
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .