Courseiva
Development with AWS ServicesmediumMultiple SelectObjective-mapped

DVA-C02 Development with AWS Services Practice Question

A DynamoDB query must support lookup by email address as well as by user ID. Which two changes may be required?

⚠ Common exam trap

Many exam-takers think a Scan is acceptable for low-volume logins, but the exam emphasizes that any production authentication system must use an index to avoid full table scans and meet latency requirements.

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 secondary index with email as a key

A Global Secondary Index (GSI) or Local Secondary Index (LSI) on the email attribute allows DynamoDB to efficiently query by email address without scanning the entire table. Since the primary key is user ID, querying by email requires an index that uses email as the partition key or sort key. Option C is correct because specifying projection attributes limits the data returned from the index or table, reducing read capacity consumption and improving 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.

  • Create a secondary index with email as a key

    Why this is correct

    This is the primary mechanism in DynamoDB to efficiently query data using an attribute other than the table's primary key. By defining a Global Secondary Index (GSI) with email as its partition key, DynamoDB builds a separate, sparse table that allows direct, high-performance lookups based on email addresses. This approach avoids costly full table scans and ensures predictable, low-latency access for user authentication or profile retrieval.

  • Scan the full table for every login

    Why it's wrong here

    Performing a full table Scan for every login attempt is highly inefficient and not scalable for production applications. A Scan operation reads every item in the table, consuming significant read capacity units (RCUs) and incurring high latency, especially as the table grows. This method would quickly become prohibitively expensive and slow, failing to meet the performance requirements of a user login system.

  • Choose projection attributes needed by the query

    Why this is correct

    Specifying only the necessary attributes to be returned by a query significantly optimizes performance and reduces cost. When you project a subset of attributes, DynamoDB transfers less data over the network and consumes fewer read capacity units, especially for items with many large attributes. This practice minimizes I/O and improves query latency, making the overall application more efficient and cost-effective.

  • Disable partition keys

    Why it's wrong here

    Partition keys are a fundamental and mandatory component of every DynamoDB table's primary key, essential for data distribution and efficient access. They determine how data is sharded across storage partitions and are critical for DynamoDB's scalability and performance model. Disabling partition keys is not possible in DynamoDB, as it would fundamentally break the table's architecture and data access mechanisms.

About these practice questions

This DVA-C02 question is part of Courseiva's 724-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 DVA-C02 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 DVA-C02 exam.