soundcloud / roshi

Roshi is a large-scale CRDT set implementation for timestamped events.
BSD 2-Clause "Simplified" License
3.15k stars 154 forks source link

Cursor instead of pagination #36

Closed pkieltyka closed 9 years ago

pkieltyka commented 9 years ago

I noticed Roshi uses the page/offset to get the next set of items. This doesn't work that well for real-time timelines, any thoughts to use a cursor instead?

One approach would be to take a next_id or prev_id cursor and a count. From this, you can get the index of the cursor id in an ordered redis set, and use that.

peterbourgon commented 9 years ago

Roshi actually supports cursor-based pagination, it's just not heavily advertised :)

pkieltyka commented 9 years ago

awesome! thanks