简体   繁体   中英

Pagination with Cassandra

I am using cassandra with nodejs and I am trying to enable paginated request from the user's end.

For now, I limited the fetchsize of every request and users can pass in the pageState parameter in the request to fetch the next results as per the doc here: http://www.datastax.com/documentation/developer/nodejs-driver/1.0/nodejs-driver/reference/paging.html

The problem with this method is that to get the results of the n-th page, a user has to sequentially make n queries to provide each time the correct pageState (assuming the fetchSize parameter is fixed.

Is there a way to paginate in such a way that users can directly access the n-th page?

Many thanks

In Cassandra, it is not possible to access directly to the (n)th page of results without requesting (n-1)th page first.

You can read more about how pagination works in a distributed system like Cassandra in this blog post .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM