MemberDecember 3, 2021 at 11:08 pm
A code that runs on a Lambda function performs a
GetItemcall from a DynamoDB table. The function runs three times every week. You noticed that the application kept receiving a
ProvisionedThroughputExceededExceptionerror for 10 seconds most of the time.
How should you handle this error?
The answer DAX should be correct because it would reduce the number of GetItem requests as they are read request to DynamoDB.. Can you explain why it’s wrong ?
In the explaination it says “This option is not the right way to handle errors due to high request rates.” but according to AWS on DAX benefits:
“Applications that are read-intensive, but are also cost-sensitive. With DynamoDB,
you provision the number of reads per second that your application requires. If
read activity increases, you can increase your tables’ provisioned read
throughput (at an additional cost). Or, you can offload the activity from your
application to a DAX cluster, and reduce the number of read capacity units
that you need to purchase otherwise.”
AdministratorDecember 4, 2021 at 3:24 am
DAX would only be effective for items that are read repeatedly. Take note that it is still a caching solution, the performance gain in reads only applies to items that are already stored in the cache, your DAX cluster stills need to fetch data from the DynamoDB table, hence it still consumes RCU. Since the ProvisionedThroughputExceededException is an error at the DynamoDB level, you can either increase the provisioned RCU or handle the error thru error retries and exponential backoff.
Let me know your thoughts.
Carlo @ Tutorials Dojo
MemberDecember 5, 2021 at 6:51 pm
Yes but the question says “most of the time”, it means that the application can run fine sometimes with the already provisioned RCU and other times it gets error.
Since DAX lowers your needs for RCU, it could be a solution given the question
What do you think ?
AdministratorDecember 7, 2021 at 4:33 am
The scenario begs for a solution that will handle intermittent ProvisionedThroughputExceededException errors. In programming, you can think of it as implementing a try and catch logic. DAX only saves RCU when reading in cache objects but not for cache misses since new updates inserted into the table are not automatically reflected in the DAX cluster. You’re implying that one should cache the objects to get around the RCU limitation. That is not the main objective of using DAX. You should also consider the workload, the manner, and the frequency with which data is retrieved.
Log in to reply.