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.

asked 2 years ago654 views
2 Answers
1
Accepted Answer

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
EXPERT
answered 2 years ago
  • 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
EXPERT
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions