DBS-C01 Workload-Specific Database Design Practice Question
Network Topology
Refer to the exhibit. A developer created a DynamoDB table 'UserSessions' with a simple primary key. The application needs to query by user_id as well. What design change should the developer make to support this query efficiently?
⚠ Common exam trap
AWS often tests the misconception that a Local Secondary Index can be used to query on any attribute, but the trap here is that an LSI requires the same partition key as the base table, so it cannot index user_id as a partition key unless user_id is already the base table's partition key.
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
✓
Create a Global Secondary Index on user_id
A Global Secondary Index (GSI) on user_id allows efficient querying by user_id without altering the base table's primary key structure. The base table uses a simple primary key (likely session_id), and a GSI provides a separate index with its own partition key (user_id) to support non-key attribute queries with eventual consistency, enabling the application to query by user_id efficiently without scanning the entire table.
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 a Scan operation with a filter
Why it's wrong here
Scan is inefficient for frequent queries.
- ✗
Add a sort key to the table
Why it's wrong here
Adding a sort key does not help query by user_id unless user_id is the partition key.
- ✗
Create a Local Secondary Index on user_id
Why it's wrong here
LSI requires the same partition key (session_id), so it cannot query by user_id alone.
- ✓
Create a Global Secondary Index on user_id
Why this is correct
A GSI enables efficient querying on user_id.
Go deeper
Related to this question
About these practice questions
This DBS-C01 question is part of Courseiva's 1,663-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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.