denoland / deno-kv-benchmarks

Benchmark Deno KV vs Upstash Redis/AWS DynamoDB Global Tables/CF Workers KV/Cloud Firestore
https://deno-kv-benchmarks-test.deno.dev/
MIT License
6 stars 1 forks source link

DynamoDB Benchmark not 1:1 #2

Closed JayJamieson closed 8 months ago

JayJamieson commented 10 months ago

Any reason we specifically configure DynamoDB GSI to only include KEYS and not data ? This has the side effect of requiring 2 "trips" for any dynamodb + lambda benchmark and doesn't accurately test it in the same way you are testing DenoKV with a single prefix query.

https://github.com/denoland/deno-kv-benchmarks/blob/main/setup/provision/databases.tf#L28

lambtron commented 9 months ago

thanks for your comment. dynamodb gsi's are eventually consistent, so reading from the index can yield stale data. but it is definitely helpful to benchmark it with direct reading from the index as well. we will amend the dynamodb implementation while also including a note that it doesn't do the same thing compared to other strongly consistent dbs.

JayJamieson commented 9 months ago

dynamodb gsi's are eventually consistent, so reading from the index can yield stale data.

This can be problematic for the benchmark, I do agree. Did you experience this while benchmarking ?

I think it's worth including two benchmarks in that case, the current benchmark performing two queries and a second that just uses the GSI and the sorted nature of the RANGE/SORT key.

lambtron commented 8 months ago

hey, we have updated the code and re ran test results: https://deno-kv-benchmarks-test.deno.dev/ aws dynamodb reads have improved about 20-30%, as a result. thanks for pointing this out and making the overall benchmark fairer for future visitors!