Soru

Zorluk: ZorOptimizing Performance with Caching and DAX

An online banking application retrieves user transaction history using an Amazon DynamoDB table. During end-of-month processing, users experience high query latencies, and the application log shows frequent `ProvisionedThroughputExceededException` errors on read operations. The primary key structure uses a partition key of `UserId` and a sort key of `TransactionTimestamp`. The developer plans to implement Amazon DynamoDB Accelerator (DAX) to achieve sub-millisecond read latency and alleviate the read workload on the DynamoDB table. The application code currently initiates reads with the parameter `ConsistentRead` set to `true`.

Which combination of actions must the developer take to resolve the performance issue and successfully utilize caching? (Select two.)

  1. Modify the application's query requests to use eventually consistent reads by setting the `ConsistentRead` parameter to `false`.Cevap
  2. Initialize the DAX client in the application code and configure it to route requests to the DAX cluster endpoint.Cevap
  3. C
    Increase the table's provisioned Read Capacity Units (RCUs) to handle the peak workload, assuming the exception is due to reaching overall table capacity limits.
  4. D
    Change the application to perform periodic `Scan` operations via the DAX client to pre-populate the cache with all transaction records.
  5. E
    Configure the DAX client by hardcoding the developer's IAM credentials directly into the client constructor to ensure authorization.

Cevap

To resolve the performance issue and enable caching, the developer must modify query requests to use eventually consistent reads by setting the consistent read parameter to false, and configure the application SDK to initialize the DAX client pointing to the DAX cluster endpoint.
To successfully leverage Amazon DynamoDB Accelerator (DAX) caching to reduce read latency and read throughput consumption, two main adjustments are required. First, the application must perform eventually consistent reads. Strongly consistent reads bypass the DAX cache and are routed directly to DynamoDB, consuming read capacity units. Setting the consistent read parameter to false enables caching. Second, the application must be updated to initialize the DAX client and target the DAX cluster endpoint so that queries go through the DAX cache layer instead of directly to DynamoDB.

Adım Adım Çözüm

1
Identify why the DAX cache is being bypassed despite cluster deployment.
Strongly consistent reads (ConsistentRead=true) always bypass DAX caching and are sent directly to DynamoDB.
DAX does not serve strongly consistent reads from its cache to guarantee strong consistency, resulting in table RCU consumption.
2
Switch read queries to eventually consistent reads.
ConsistentRead parameter is set to false in the read API options.
Eventually consistent reads allow DAX to serve the data from its item or query cache, avoiding calls to the underlying table.
3
Configure the application to route requests through DAX.
The SDK's standard DynamoDB client is replaced with the DAX client, configured with the DAX cluster endpoint.
Without targeting the DAX cluster endpoint, the application will continue to query the DynamoDB endpoint directly.

Anahtar Kavram

Amazon DynamoDB Accelerator (DAX) configuration, caching behavior for strongly consistent reads, and client initialization best practices.
Bu soruyu puanla