2
votes

I'm working on a spring boot application which queries a DynamoDB to retrieve a list of items. I want to use pagination and jump to a particular page.

Eg.

url: /items?pageno=10&pagesize=20

response: { items:[{item1}, {item2}, {item3}...{item10}], "page":3, "perPage": 10, "total": 4000}

Does dynamoDB support such pagination where one can jump to a particular page without iterating over the others.

1
As I know, DynamoDB does not support pagination directly. You can investigate this library - looks like it has some pagination implementation for DynamoDBTaras Sheremeta

1 Answers

0
votes

There is no good solution which you can build over DynamoDB for pagination. a) You can create entities with assigned page numbers and then simply use this attribute while querying for data. b) Create another search index outside DynamoDB which can be used for pagination and then query dynamodb for the ids belonging to those pages.