2 ms·
edit: I just saw another comment of yours, so I see this was meant more contextually than I realized. Can you explain why offsets would never be a suitable sol
by steve_adams_86 4y ago
edit: I just saw another comment of yours, so I see this was meant more contextually than I realized.
Can you explain why offsets would never be a suitable solution? Is there a clear explanation as to why?
I understand how cursors are superior in some cases. But what if you have a site which paginates static data? Offsets would allow you to cache the results easily, overcoming any performance concerns (which would be irrelevant if the dataset was small anyway), providing a better user experience (and developer experience due to simpler implementation details) overall.
I can see that it would be a novice move if you’ve got staggering amounts of records that take a while to query. But that’s actually pretty rare in my experience.
- MAGZine 4y agoIt doesn't even have to be a cursor, you can technically page off of any field you can index (i've written a lot of sync APIs so there are gotchas, but the point stands). Limit/offset is usually (though not always, as you point out) egregious for anything more than hobbies or small projects. But, I am biased as when I build APIs, I definitely expect some amount of traffic/volume/tuple count, and offset/limit will not do.
- steve_adams_86 4y agoCool, I think we mostly agree. Thanks for the explanation!