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

A developer is working on a web application that uses Amazon DynamoDB as its data store. The application has two DynamoDB tables: one table that is named artists and one table that is named songs. The artists table has artistName as the partition key. The songs table has songName as the partition key and artistName as the sort key.

The table usage patterns include the retrieval of multiple songs and artists in a single database operation from the webpage. The developer needs a way to retrieve this information with minimal network traffic and optimal application performance.

Which solution will meet these requirements?

Answer options

Correct answer: A

Explanation

The correct answer is A because it allows for a BatchGetItem operation across both tables, reducing network traffic by retrieving multiple items in a single request. Options B and C involve multiple queries or BatchGetItem operations that could increase latency due to separate operations for each key. Option D is inefficient as Scan operations read every item in the table, leading to higher costs and slower performance.