1
votes

In AWS documentation for dynamodb they describe the best practices for storing timeseries data in dynamodb (https://docs.aws.amazon.com/en_pv/amazondynamodb/latest/developerguide/bp-time-series.html).

What is the best practice for accessing this data when you want following access pattern:

  • Get rows between two data ranges that are not a hole unit like an hour or a week. Eg. from 2019-11-03 22:01:50 to 2019-11-04 04:10:35. As you can not query hashkey, and inserting a dummy hashkey sounds like a bad idea. If i use 2019-11-03 as primary key then i have to query first 2019-11-03 and then 2019-11-04 which also sounds like a bad solution.
1

1 Answers

1
votes

I wouldn't call multiple queries a "bad" solution...

In fact, since you should be able to do them in parallel, overall response time might be less than if you could do then with a single query.

You don't provide any estimate of the number of writes/reads per second, nor if you have other access requirements; so it's hard to say what would work best.

I will point out that AWS time series example supports very high volume of data flowing into the table.

If your volume isn't that high, you might be able to have a hash key of YYYY-MM instead of YYYY-MM-DD. Sort key would then be DD HH:MM:SS.xxxxxx

Still would need multiple queries if you query across months...