Courseiva
Workload-Specific Database DesignhardMultiple ChoiceObjective-mapped

DBS-C01 Global Secondary Index (GSI) Practice Question

A gaming company uses Amazon DynamoDB to store player scores. The table has a partition key of 'game_id' and a sort key of 'player_id'. The application needs to retrieve the top 10 players for a given game_id based on score (stored as an attribute). The game_id has high cardinality. The team wants to avoid full table scans. Which design pattern is MOST efficient?

⚠ Common exam trap

Candidates may think a Local Secondary Index (LSI) with sort key 'score' is a good fit because it shares the same partition key 'game_id' and allows ordering by score. However, LSIs share throughput capacity with the base table and have a 10 GB storage limit per partition key value. For high-cardinality game_id values with many players, the 10 GB limit can be restrictive, and the shared throughput may lead to throttling. A Global Secondary Index (GSI) provides dedicated throughput and is the recommended pattern for top-N queries.

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 with partition key game_id and sort key score

A global secondary index (GSI) with partition key 'game_id' and sort key 'score' allows DynamoDB to efficiently retrieve the top 10 players for a given game_id by querying the index with the Query API, using ScanIndexForward=false to get items in descending order of score, and Limit=10. This avoids full table scans and leverages GSI's separate throughput capacity. Option C (LSI) could theoretically be used if the table was created with the LSI, but GSIs are preferred because they can be added after table creation, have dedicated throughput, and are more scalable. Additionally, querying an LSI still consumes base table capacity, which may affect performance.

Answer analysis

Option-by-option breakdown

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

  • Query the table by game_id and sort the results in the application

    Why it's wrong here

    All items in the partition are read; sorting in app is wasteful.

  • Use a Scan operation with a filter expression and limit 10

    Why it's wrong here

    Scan reads all items and is inefficient and expensive.

  • Create a local secondary index with partition key game_id and sort key score

    Why it's wrong here

    LSI requires the same partition key but different sort key; however, it shares table's RCU/WCU and has a 10 GB limit per partition key.

  • Create a global secondary index with partition key game_id and sort key score

    Why this is correct

    Query the GSI with ScanIndexForward=false and limit 10 for fast retrieval.

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.