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.)
- Use the Query API operation with a key condition expression specifying the CustomerId.Cevap
- BUse the Scan API operation with a filter expression specifying the CustomerId.
- Use the default credential provider chain to initialize the AWS SDK client.Cevap
- DHardcode the AWS access key ID and secret access key in the application's client initialization code.
- EIncrease the table's provisioned read capacity units (RCU) to resolve the throttling issues caused by the Scan operation.
Cevap
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.
Adım Adım Çözüm
Anahtar Kavram
Optimizing DynamoDB retrieval operations with Query and managing SDK credentials securely.
Tahmini Süre:1m 0s