AWS Certified Developer – Associate (DVA-C02) — Question 460

A developer is creating an application that uses an Amazon DynamoDB table. The developer needs to develop code that reads all records that were added to the table during the previous day, creates HTML reports, and pushes the reports into third-party storage. The item size varies from 1 KB to 4 KB, and the index structure is defined with the date. The developer needs to minimize the read capacity that the application requires from the DynamoDB table.

Which DynamoDB API operation should the developer use in the code to meet these requirements?

Answer options

Correct answer: A

Explanation

The Query operation is the most efficient choice because it utilizes the date-based index to retrieve only the items from the previous day, thereby minimizing the read capacity units (RCUs) consumed. In contrast, a Scan operation would evaluate every item in the table, which is highly inefficient and costly in terms of read capacity. GetItem and BatchGetItem are not viable options because they require knowing the specific primary keys of the target items beforehand.