Running Turtle
unread,Nov 6, 2012, 2:48:28 AM11/6/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to redi...@googlegroups.com
Hello, I'm currently building a web app using Redis as the main database with data passed to client in JSON format.
The webapp has a social component and users can follow other users.
I want to build a profile page with a very basic functionality where a user is able to see a list
of say, 20 followers, with a button ("see more") which will display
another 20 followers (different from the first 20) each time it is pressed.
Using SETS to store followers ids (user:[userId]:followerIds), I wasn't able to come up with a trivial implementation of the functionality. So far, because I want to keep followerIds in SETS in order to be able to use commands like SMEMBERS, the "less ugly" solution I can think of is to have a LIST of follower ids in addition to the SET, and then use LRANGE to "paginate" through the followerIds. This should work, but isn't a very satisfying solution.
If anybody was faced with the same problem or has any pointer to a more elegant solution, I'd be eager to read it.
Thanks