ResponseMetadata not provided by AWS DAX queries

113 Views Asked by At

I have been using DAX on top of my DynamoDB queries. I will write Lambda functions and test them locally. However I can only use DAX in a VPC so as far as I can tell I cannot use DAX locally. To get around this I have a databse handler that either uses DAX or Dynamo depending on the env. This means however that I am never using DAX during my development and have noticed that the Lambda logs show that the response from DAX is basically empty, and where I am using the expected ResponseMetadata in my code to verify the success or failure of a query.

I need to work out how to use DAX locally really but essentially I would love to know even more how to work with this lack of a response and whether I can get one out of it? Or if I should just rely on the result of try/except.

Thanks for any help or suggestions!

1

There are 1 best solutions below

0
On

DAX would throw an exception if the response was a non 200, which you would catch in your try/catch. Allowing all_old is incase you overwrite an item and want to know its values, you already know the new values as thats what you are currently writing.

In DynamoDB you will only get a 200 if the item is persisted to at least 2/3 storage nodes, which means items are always durable when you receive a 200 response.

https://repost.aws/questions/QUEruXJYA7RSynZtxkcfhPyg/dax-in-front-of-dynamo-does-not-reply-with-response-metadata

TLDR: Don't rely on ResponseMetadata, use Try/Catch (exception)