When cursoring, the encoded cursor can be long. However, all the data is in the db and is uniquely identified by the id.
So, use the id of the last (first when reverse) item as the cursor and when getting the next page, first get the cursor values. It can probably be done in a single query so the latency impact should be small.
When cursoring, the encoded cursor can be long. However, all the data is in the db and is uniquely identified by the id.
So, use the id of the last (first when reverse) item as the cursor and when getting the next page, first get the cursor values. It can probably be done in a single query so the latency impact should be small.