DEV Community

Discussion on: Why You Shouldn't Use OFFSET and LIMIT For Your Pagination

Collapse
 
sam_ferree profile image
Sam Ferree

This is a neat trick when Id’s are incrementing integers, and maybe that’s not a base thing to do in some cases. But ahem:

“ insertions and deletes may happen meanwhile and we don’t outdated data!”

(Laughs in eventually consistent, highly indexed query models)

Consistency is an illusion. Strong Consistency doubly so.

Collapse
 
ivoecpereira profile image
Ivo Pereira

Excellent point on consistency and that quote @sam_ferree !

The point I have made is referring to the benefits in an exact comparison of this cursor-based approach with the traditional SQL approach to this situation.

Would you suggest anything different here?

Collapse
 
sam_ferree profile image
Sam Ferree

Nope paging by ID is pretty nifty in this use-case

Collapse
 
moopet profile image
Ben Sinclair

Is it lunch time already?