DAX in front of Dynamo does not reply with ResponseMetadata

0

I have been working on an application that uses Dynamo DB. In places I need to verify the success of a query, and so have been using the response from Dynamo that includes the ResponseMetadata to determine if it was a success. I have now started putting DAX in front of these queries, but because of the lack of ResponseMetadata my existing code assumes the query failed. It's quite frustrating because DAX has to be in a VPC which means I my local uses Dynamo directly and I have to deploy new code to see what happens with DAX.

Can I configure DAX to return a response? Can I configure DAX to work locally?

Thanks!

Simon
질문됨 일 년 전289회 조회
1개 답변
1

Unfortunately DAX is a VPC only service, you would be unable to connect to it locally with ease. Can you share with me which ResponseMetadata you are dependent on, I can raise a feature request with the DAX team internally to expose the metadata in the response.

profile pictureAWS
전문가
답변함 일 년 전
  • Thanks Leeroy!

    I am checking that the HTTPStatusCode returns as 200

    If I use return_values=all_old, it does return the old values - but I don't think I can surmise that having old values means that it was deleted, nor if there is an empty all_new.

  • Creation also only allows all_old but then returns nothing because it's all new. This all seems a bit odd.

  • 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.

  • Thanks Leeroy! I will bare that in mind and adjust accordingly :)

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠