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

Added pagination section #34

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Added pagination section #34

wants to merge 2 commits into from

Conversation

naelrashdeen
Copy link

Fixes #7

Copy link
Contributor

@cweinberger cweinberger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Nael, looks good! Just a few suggestions:

I would add the actual pros and cons of both pagination mechanisms.

E.g. mention that Offset pagination does not work well with dynamic content (content is added or removed frequently). Imagine being on a timeline (like Twitter, Facebook) and new posts come in on top while you are in the middle. When you request the next page the pagination will be broken (same content is shown).

Also it might be relevant to mention complexity when it comes to DB queries. Offset pagination usually has a complexity of O(N) while Cursor pagination has O(1).

We should also mention that implementing cursor-based pagination is not trivial and should only be considered where it makes sense :)

Comment on lines +660 to +665
"links": {
"first": "https://example-test.like.st/api/test?page=1",
"last": "https://example-test.like.st/api/test?page=1",
"prev": null,
"next": null
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a detail, but I would probably move links inside of meta

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

Successfully merging this pull request may close these issues.

Topic: Pagination
2 participants