Which statement best describes the performance difference between a Scan and a Query operation in DynamoDB?
Think about how many items each operation reads from the table.
Scan reads every item in the table, which makes it slower and more resource-intensive. Query uses the primary key to find specific items, making it faster and more efficient.
You perform a Scan and a Query on a DynamoDB table with 1000 items. The Query uses a partition key that matches 50 items. How many items will each operation read?
Consider what each operation scans or queries in the table.
Scan reads all 1000 items regardless of filter. Query reads only the 50 items matching the partition key.
You want to design a DynamoDB table to minimize the use of Scan operations for better performance. Which design choice helps achieve this?
Think about how keys help DynamoDB find data quickly.
Using partition and sort keys allows Query operations to efficiently retrieve data without scanning the entire table, improving performance.
Which security risk is higher when using Scan operations compared to Query operations in DynamoDB?
Consider how much data each operation accesses.
Scan reads all items, which can expose more data if permissions are not tightly controlled. Query limits data access to specific keys, reducing exposure.
You manage a DynamoDB table with millions of items. You need to retrieve items matching a specific attribute that is not part of the primary key. Which approach is best to maintain performance?
Think about how to query non-key attributes efficiently.
Creating a GSI allows Query operations on non-key attributes efficiently, avoiding costly Scan operations on large tables.