AWS Certified Data Engineer Associate DEA-C01 Practice Question
A retail company needs to store order events in a single Amazon DynamoDB table. Each item contains the attributes customer_id, order_id (UUID), order_timestamp (ISO-8601 string), and order_total. Business requirements are:
Retrieve all orders for a given customer within an arbitrary date range, sorted by most-recent first.
Show the latest N orders for a customer on the mobile app's home screen.
Look up a specific order when only the order_id is known (for example, from a help-desk ticket). Each customer places no more than a few hundred orders per year, and the company wants to minimize storage and read costs. Which table design best meets these requirements?
Define the table's primary key as partition key customer_id and sort key order_timestamp, and add a GSI with partition key order_id and no sort key.
Define the table's primary key as partition key customer_segment and sort key order_timestamp, and add a GSI with partition key order_id and sort key customer_id.
Define the table's primary key as a concatenated partition key customer_id#order_timestamp and sort key order_id, with no secondary indexes.
Define the table's primary key as partition key order_id with no sort key, and create a GSI with partition key customer_id and sort key order_timestamp.
Using customer_id as the partition key and order_timestamp as the sort key groups each customer's orders into a single item collection. A query on this primary key can use key-condition expressions and ScanIndexForward=false to return a reverse-chronological result set, satisfying requirements 1 and 2 with a single strongly consistent request. Creating a sparse GSI whose partition key is the unique order_id enables constant-time point lookups for requirement 3 without duplicating the entire dataset in a separate table. Because each customer issues only a few hundred writes per year, the per-partition write throughput and 10 GB item-collection limit are not a concern, and the design avoids the extra storage charges that would result from projecting all attributes into a GSI that uses customer_id as the partition key. The other options either make range queries inefficient, duplicate all data into a secondary index, or create hot partitions that violate best practices.
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.
How does DynamoDB's partition key and sort key work together?
Open an interactive chat with Bash
What is a GSI in DynamoDB and how is it used in this solution?
Open an interactive chat with Bash
Why is ScanIndexForward=false important for range queries?
Open an interactive chat with Bash
Why is customer_id used as the partition key instead of order_id?
Open an interactive chat with Bash
What is a sparse GSI and why is order_id used as its partition key?
Open an interactive chat with Bash
How does the design avoid storage and throughput inefficiencies?
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 .