Courseiva
Workload-Specific Database DesignmediumMultiple ChoiceObjective-mapped

DBS-C01 Workload-Specific Database Design Practice Question

A company is building a real-time chat application using Amazon DynamoDB. Each message has a conversation ID, timestamp, sender, and content. The primary access pattern is to retrieve the most recent 50 messages for a given conversation, ordered by timestamp. Which table design minimizes cost and latency?

⚠ Common exam trap

The trap here is that candidates may over-engineer the solution by adding unnecessary components like DAX or GSIs, when DynamoDB's native sort key and query parameters directly solve the access pattern with minimal cost and latency.

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 conversation ID as partition key and timestamp as sort key; query with ScanIndexForward=false and Limit=50.

Using conversation ID as the partition key and timestamp as the sort key allows a single Query operation with ScanIndexForward=false to retrieve items in reverse chronological order, and Limit=50 ensures only the most recent 50 messages are returned. This design minimizes cost by avoiding full table scans or additional indexes, and minimizes latency by leveraging DynamoDB's native sort key ordering without needing external caching or streams.

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 composite primary key of conversation ID and message ID, and enable DynamoDB Streams to process messages.

    Why it's wrong here

    Message ID does not preserve order; streams are not needed.

  • Use DynamoDB Accelerator (DAX) to cache the most recent messages.

    Why it's wrong here

    DAX is unnecessary and adds cost; the query is already efficient.

  • Use conversation ID as partition key and timestamp as sort key; query with ScanIndexForward=false and Limit=50.

    Why this is correct

    Directly supports the access pattern without additional indexes.

  • Use conversation ID as partition key and a GSI on timestamp.

    Why it's wrong here

    GSI adds unnecessary cost; the sort key can be used directly.

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.