Question

Difficulty: EasyData Store Operations with Amazon DynamoDB

A developer is developing an application that retrieves order history for a customer from an Amazon DynamoDB table. The table uses `CustomerId` as the partition key and `OrderTimestamp` as the sort key. Currently, the application retrieves data by fetching all items from the table and filtering them in memory, and the AWS SDK client is initialized using hardcoded AWS access keys. Which two actions should the developer take to resolve these performance and security issues? (Select TWO.)

  1. Use the Query API operation with a key condition expression specifying the CustomerId.Answer
  2. B
    Use the Scan API operation with a filter expression specifying the CustomerId.
  3. Use the default credential provider chain to initialize the AWS SDK client.Answer
  4. D
    Hardcode the AWS access key ID and secret access key in the application's client initialization code.
  5. E
    Increase the table's provisioned read capacity units (RCU) to resolve the throttling issues caused by the Scan operation.

Answer

To resolve the performance and security issues, the developer should use the Query API operation with a key condition expression specifying the partition key (CustomerId), and use the default credential provider chain to initialize the AWS SDK client rather than hardcoding credentials.
The correct options are to use the Query API operation and the default credential provider chain. The Query operation optimizes data retrieval by targeting specific partition key values, minimizing read capacity consumption and latency. The default credential provider chain securely retrieves credentials from the environment or IAM roles without hardcoding them.

Step-by-Step Solution

1
Identify the data retrieval method optimization.
Determine that switching from Scan to Query using the CustomerId partition key reduces read capacity unit (RCU) consumption and latency.
Query retrieves only matching partition key items, whereas Scan reads the entire table.
2
Identify the secure client initialization method.
Determine that using the default credential provider chain avoids hardcoding credentials.
Hardcoded credentials present a significant security vulnerability.

Key Concept

Optimizing DynamoDB retrieval operations with Query and managing SDK credentials securely.
Estimated Time:1m 0s
Rate this question