Courseiva
Development with AWS ServiceshardMultiple ChoiceObjective-mapped

DVA-C02 Development with AWS Services Practice Question

A developer uses the AWS SDK to list thousands of DynamoDB items from a query. Only the first page is processed. What should be implemented?

⚠ Common exam trap

Many exam-takers assume DynamoDB returns all matching items in a single response, overlooking the 1 MB pagination limit and the necessity of handling `LastEvaluatedKey` in a loop.

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

Pagination using LastEvaluatedKey until no further key is returned

The DynamoDB Query API returns paginated results, with a maximum of 1 MB of data per page. The `LastEvaluatedKey` in the response indicates that more items exist. To retrieve all items, the application must check for `LastEvaluatedKey` and, if present, issue a subsequent Query request with the `ExclusiveStartKey` parameter set to that value, repeating until `LastEvaluatedKey` is no longer returned. This is the standard pagination pattern for DynamoDB.

Answer analysis

Option-by-option breakdown

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

  • Pagination using LastEvaluatedKey until no further key is returned

    Why this is correct

    DynamoDB `Scan` and `Query` operations return results in 1MB chunks. To retrieve thousands of items, the developer must repeatedly call the API, passing the `LastEvaluatedKey` from the previous response as the `ExclusiveStartKey` in the subsequent request. This pagination continues until `LastEvaluatedKey` is no longer present in the response, indicating all items matching the criteria have been retrieved. This is the standard and most efficient way to handle large result sets.

  • A larger Lambda memory setting only

    Why it's wrong here

    Increasing a Lambda function's memory setting primarily allocates more CPU and network bandwidth, which can speed up processing within the function. However, it does not alter the fundamental behavior of DynamoDB API calls, which are inherently limited to returning a maximum of 1MB of data per request for `Scan` or `Query` operations. Therefore, a larger memory setting alone will not enable the retrieval of thousands of items in a single API call.

  • A global secondary index with the same key

    Why it's wrong here

    A Global Secondary Index (GSI) is designed to support different query patterns by allowing non-primary key attributes to be used as the index key. Creating a GSI with the *same* key as the base table offers no new access patterns or performance benefits for the stated requirement, as it essentially duplicates the primary key structure. Furthermore, even queries against a GSI are subject to the same 1MB result set limit per API call, necessitating pagination for large datasets.

  • Strongly consistent reads on every request

    Why it's wrong here

    Strongly consistent reads ensure that the data returned is the most up-to-date version, reflecting all successful writes prior to the read. While crucial for applications requiring immediate data accuracy, choosing strongly consistent reads does not impact the pagination mechanism or the 1MB data limit imposed on DynamoDB `Scan` or `Query` operations. The developer would still need to paginate through results using `LastEvaluatedKey` regardless of the consistency model chosen.

About these practice questions

One of 724 original DVA-C02 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.