Discussion about this post

User's avatar
Neural Foundry's avatar

Great breakdown of how these two approaches work in practice. For the question about result size in LIMIT-OFFSET, I think it depends a lot on the use case. For Spotify albums, showing 20-50 per page makes sense becuase most artists dont have hundreds of albums, so the OFFSET overhead stays managable. But for something like a music library with thousands of songs, you'd probably want to avoid LIMIT-OFFSET entirely. On the cursor expiry question, thats a tricky balance. I think cursors should definitly expire for security and to prevent stale data issues, but the expiry window needs to be long enough for normal usage patterns. Maybe 24-48 hours? If the record at the cursor gets deleted, the system could either skip to the next available record or return an error and force a refresh. The first option seems more user friendly though.

Expand full comment

No posts