Reputation: 83
We have an application where the client needs to request some information stored on DynamoDB filtering by date. We have the service created with API Gateway and a Lambda retrieving the corresponding records on DynamoDB, so we have to retrieve all the necessary records in <30segs.
The volume of the records keeps increasing and we have thought in the following:
Is there any way on DynamoDB to get the records from a concrete position to a concrete position? Or the only way is to retrieve all the records for that date range and then send the concrete positions to the client?
Thank you in advance, Best regards.
Upvotes: 0
Views: 107
Reputation: 7142
You don’t specify a schema so I’m going to give you one. :)
Setup a sort key that’s the position number. Then you can efficiently retrieve by position number range.
Or instead of using ordinals if you want to use timestamps then just pass to the client the sort key starting point for their next request and use it as the lowrr value for the next query.
There’s no way to efficiently find the Nth many item in an item collection.
Upvotes: 1