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 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南