Courseiva
Workload-Specific Database DesignmediumMultiple ChoiceObjective-mapped

DBS-C01 Workload-Specific Database Design Practice Question

A company is building a mobile application that requires users to be able to query their order history quickly. The data is stored in Amazon DynamoDB, and each user has up to 10,000 orders over time. The application needs to support pagination and filtering by order date. What is the MOST efficient way to model this data in DynamoDB?

⚠ Common exam trap

A common mix-up: candidates choose a Global Secondary Index (Option C) thinking it is necessary for date-based filtering, but the sort key on the base table is more efficient and avoids the cost and eventual consistency of a GSI when the partition key already isolates the user's data.

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

Use user ID as the partition key and order date as the sort key

Using user ID as the partition key ensures all orders for a user are co-located on a single partition, enabling efficient queries. Adding order date as the sort key allows the application to filter and paginate by date range using the Query API with KeyConditionExpression, which is far more efficient than scanning or using a secondary index.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Scan the entire table and filter on user ID

    Why it's wrong here

    Scanning is inefficient and costly for large tables.

  • Store all orders as a JSON document in a single item per user

    Why it's wrong here

    Item size limit of 400 KB may be exceeded, and partial updates are complex.

  • Use user ID as the partition key and a Global Secondary Index on order date

    Why it's wrong here

    GSI adds cost and eventual consistency trade-offs.

  • Use user ID as the partition key and order date as the sort key

    Why this is correct

    Allows range queries on order date and efficient pagination.

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 →

How Courseiva writes practice questions · Editorial policy

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.