DynamoDB response time on a simple PartiQL query

0

Hi, I'm trying a basic PartiQL query to get an attribute for a table like this:

PKSKValue
p1s110
p2s220

SELECT Value FROM "Table" WHERE "PK" = 'p1' AND "SK" = 's1'

When I try this on a table with only 2 items using the PartiQL Editor on the AWS Console I get response times around 200ms.
Is that response time expected ?
Is there some overhead because of PartiQL or maybe the console is not the correct way to ensure the response time ?
When I try using a Go app I'm seeing similar response times.

Thanks for any help.

질문됨 2년 전672회 조회
2개 답변
1
수락된 답변

The latency that you are observing includes network and client latency. If you are interested in just the DynamoDB latency, the Cloudwatch metric https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/metrics-dimensions.html#SuccessfulRequestLatency will provide you with the actual DynamoDB latency.

If you wish to determine the full round-trip latency from the client to DynamoDB and back, you may want to run the queries from an EC2 machine running inside a VPC that has a VPC endpoint for DynamoDB configured, so the traffic goes over the Amazon network and not over the internet.

DynamoDb also has DynamoDB Accelerator (DAX) that can improve read latency - https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DAX.concepts.html

profile pictureAWS
전문가
답변함 2년 전
  • Thanks, I was hoping that the response time returned by the AWS Console PartiQL editor was not taking into account the latency.

1

The latency you are witnessing is due to the ad-hoc queries you are running. DynamoDB makes use of metadata caching to reduce the latency for your requests, however, when you make only a small number of requests then your metadata cache is stale, meaning your request must do things like AuthN/AuthZ, along with other off the box hops.

DynamoDB aims to deliver single digit millisecond response time of singleton operations, this would be quite tricky to achieve via the Web Console there are only so many requests you can submit in a given amount of time. Your Go app should be able to reduce the latency much much further once you make frequent requests to DynamoDB. You can find more information here to help you make effective decisions to reduce latency.

profile pictureAWS
전문가
답변함 2년 전

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

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

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

관련 콘텐츠