Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Pagination caps? #66

Closed
karloscodes opened this issue Feb 15, 2017 · 8 comments
Closed

Question: Pagination caps? #66

karloscodes opened this issue Feb 15, 2017 · 8 comments

Comments

@karloscodes
Copy link

Is it possible to get LastEvauatedKey and pass it to queries to perform forward pagination?

@sid88in
Copy link

sid88in commented Aug 23, 2017

hey @ccverak did you figure this out? I am trying to understand pagination in dynamodb as well. https://forums.aws.amazon.com/thread.jspa?threadID=262177&tstart=0

@cdhowie
Copy link
Collaborator

cdhowie commented Nov 20, 2017

@ccverak The object returned from query/scan operations includes LastEvaluatedKey alongside Items, but I don't think query/scan provides an API to provide this value.

Honestly, pagination should just be something we provide as a method on the returned object. There's no reason for developers to have to deal with directly passing that value around.

@apalaniuk
Copy link

Does startKey() not provide this?

@cdhowie
Copy link
Collaborator

cdhowie commented Nov 20, 2017

You are right, I missed that when scanning the source code. In that case, there's nothing to do here. (Though I would like to add a next() method to the result object that will encapsulate this logic.)

@cdhowie cdhowie closed this as completed Nov 20, 2017
@iDVB
Copy link

iDVB commented Feb 2, 2018

Does startKey() completely solve this?
Just thinking about this now. Does this not mean the frontend needs to track all keys, in order to know which is the first of a block of say 20?

Example: What if a user goes directly to this link domain.com/search?page=3&pagesize=10

How would the front end know what startkey() to send if they want to go back a single page?

@cdhowie
Copy link
Collaborator

cdhowie commented Feb 4, 2018 via email

@iDVB
Copy link

iDVB commented Feb 4, 2018

@cdhowie Ya I think my disconnect here was that from an architecture point of view, DynamoDB itself is not the type of DB to handle backward paging lookups like this. We're getting around this by using ElasticSearch for things like this.

So naturally any ORM is not going to correct the underlining arch consideration.

@cdhowie
Copy link
Collaborator

cdhowie commented Feb 4, 2018

Right. Any workaround would be something at the application level, not the ORM. (Though dynogels isn't even an ORM, it's just an OM.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants