Q69 — AWS DVA-C02 Ch.2

Question 69 of 100 | ← Chapter 2

There is a table named 'artists' and another named 'songs'. The 'artists' table uses 'ArtistName' as its partition key. The 'songs' table uses 'songName' as its partition key and 'artistName' as its sort key. The access pattern includes retrieving multiple songs and their corresponding artists in a single database operation. A developer wants the solution that minimizes network traffic and delivers optimal application performance when retrieving this information. Which solution meets these requirements?

Correct Answer: A. Perform a BatchGetItem operation to retrieve items from both tables. Use a list of songName/artistName keys for the songs table and a list of artistName keys for the artists table.

Explanation

This scenario requires optimizing cross-table retrieval with minimal network round trips and high efficiency. Option A uses BatchGetItem to fetch items from both tables in a single operation: songName/artistName keys for songs and artistName keys for artists. This reduces network overhead and improves performance. Option B requires multiple queries per artist, increasing round trips. Option C treats the two tables separately but still achieves batched retrieval—however, it doesn’t explicitly coordinate keys across tables like A does, and A is more precise for correlated lookups. Option D uses scans, which are inefficient and costly for large datasets due to full-table reads and filtering. Thus, option A best satisfies the requirement for single-operation, low-network, high-performance retrieval.