How can i do a pagination in cassandra based web application. I am using spring MVC on server side and jquery on client side. I tried this but was not sutisfied.
My row key is UUIDType and every time i am sending the start key as string from client browser so dont know how to convert it back to UUID. A simple example will be appriciated.
Spring-data has this functionality pre-rolled :
http://static.springsource.org/spring-data/data-jpa/docs/current/reference/html/repositories.html#web-pagination
I would suggest generic solution which shall work for any language. I used python pycassa to work this out:
First approach:
Second approach ( I used in production ):
My second approach worked pretty good with small/medium amount of data.
If you use PlayOrm for cassandra it returns a cursor when you query and as your first page reads in the first 20 results and displays it, the next page can just use the same cursor in your session and it picks up right where it left off without rescanning the first 20 rows again.
Dean