Getting random objects filtered by a set of criteria

Sean Cribbs seancribbs at
Sat Jan 9 11:10:31 EST 2010

If your bucket is small-to-medium, I would list keys in the bucket and 
select a random key from that list.  You'd likely want to cache that 
list if it gets very big, or move on to a custom M/R job if the bucket 
gets even larger.


On 1/9/10 11:01 AM, Dmitrii Dimandt wrote:
> I want to show the user a photo to vote for. This has to be a random photo from those he hasn't voted for yet.
> In a prior conversation Kevin Smith suggested[1] I use M/R for such a task. Well, not only do I have to understand how to write such a M/R :) I also need to know whether  it's ok to run such a query on every page request.
> [1] ,
> _______________________________________________
> riak-users mailing list
> riak-users at

More information about the riak-users mailing list