Courseiva
Workload-Specific Database DesignmediumMultiple ChoiceObjective-mapped

DBS-C01 Workload-Specific Database Design Practice Question

A company uses Amazon DynamoDB to store IoT sensor data. Each sensor writes a record every second, and the application needs to query the last 24 hours of data for a specific sensor. The query must be very fast. Which table design and query pattern will minimize cost and latency?

⚠ Common exam trap

Candidates often choose Option C, mistakenly thinking that timestamp as a partition key provides global time ordering, but this actually scatters sensor data across partitions, making per-sensor queries impossible without a full scan.

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 a composite primary key: partition key = sensor ID, sort key = timestamp

Using a composite primary key with partition key = sensor ID and sort key = timestamp allows DynamoDB to efficiently query all items for a specific sensor in a single partition, using the Query API with a sort key condition on timestamp. This design ensures fast, targeted reads without scanning, minimizing read capacity units and latency.

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 simple primary key (sensor ID) and scan the table filtering by timestamp

    Why it's wrong here

    Scan is expensive and slow for large tables.

  • Use a composite primary key: partition key = sensor ID, sort key = timestamp

    Why this is correct

    This allows efficient range queries on timestamp for a sensor.

  • Use a composite primary key: partition key = timestamp, sort key = sensor ID

    Why it's wrong here

    This would scatter data across partitions but still require a scan for a sensor.

  • Use a simple primary key (sensor ID) and a global secondary index on timestamp

    Why it's wrong here

    GSI adds cost and querying by sensor ID then filtering by timestamp is less efficient.

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 →

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.