An e-commerce platform uses an Amazon DynamoDB table to store product inventory details. During flash sales, the application experiences a massive surge in read requests, resulting in intermittent ProvisionedThroughputExceededException errors. To reduce read latency to sub-milliseconds, the developer integrates an Amazon DynamoDB Accelerator (DAX) cluster. However, the developer notices that several critical inventory check operations, which must retrieve the most up-to-date quantities using strongly consistent reads, continue to suffer from high latency and still trigger throttling on the underlying DynamoDB table. Additionally, some reporting scripts perform full scans of the inventory and are also experiencing performance issues. Which of the following is the most appropriate explanation and resolution for this behavior?
- AThe application's IAM execution role lacks the dax:GetItem permission, causing the DAX client to fail open and default to standard DynamoDB calls. To resolve this, update the IAM policy and adjust the Lambda function's timeout configuration to prevent execution contexts from being prematurely terminated during spikes.
- BThe DAX cluster is experiencing throttling because the inventory check queries are hitting a hot partition key that exceeds the DAX node capacity. To resolve this, scale up the provisioned write capacity of the underlying DynamoDB table and keep using Scan operations to distribute the read load evenly across all partitions.
- Strongly consistent reads are not cached by DAX and are passed directly through to the DynamoDB table, consuming provisioned read throughput. To resolve the throttling and latency, modify the inventory checks to use eventually consistent reads so they are served from the DAX item cache, and rewrite the reporting scripts to retrieve items using Query operations instead of Scan operations.Cevap
- DStrongly consistent reads bypass the DAX cache only if they are executed within a DynamoDB transaction. To resolve this, wrap the inventory checks in a TransactGetItems API call and configure the reporting scripts to execute Scan operations with a smaller Limit parameter to prevent ProvisionedThroughputExceededException.