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

A developer is working on an app for a company that uses an Amazon DynamoDB table named Orders to store customer orders. The table uses OrderID as the partition key and there is no sort key. The table contains more than 100,000 records. The developer needs to add a functionality that will retrieve all Orders records that contain an OrderSource attribute with the MobileApp value.

Which solution will improve the user experience in the MOST efficient way?

Answer options

Correct answer: D

Explanation

Creating a Global Secondary Index (GSI) with OrderSource as the partition key allows the developer to use the highly efficient Query operation to find all matching items instantly. Performing a Scan operation is highly inefficient and slow for tables with more than 100,000 records because it reads every item in the table. An LSI cannot be used here because it requires the same partition key as the base table, and configuring OrderSource as a GSI sort key without a GSI partition key does not allow querying by OrderSource directly.