2

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.

Arun Selin
  • 603
  • 4
  • 11
  • As I know, DynamoDB [does not support](https://stackoverflow.com/questions/32788959/pagination-with-dynamodbmapper-java-aws-sdk) pagination directly. You can investigate this library - [looks like](https://github.com/michaellavelle/spring-data-dynamodb) it has some pagination implementation for DynamoDB – Taras Sheremeta Jan 07 '18 at 10:35
  • Refer this post https://stackoverflow.com/questions/32788959/pagination-with-dynamodbmapper-java-aws-sdk – notionquest Jan 07 '18 at 19:36

1 Answers1

0

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.

Vishal Raja
  • 303
  • 1
  • 8