Millions of buckets?

alexeypro me at alexeypro.com
Wed May 11 14:39:21 EDT 2011


I have a need to keep "notifications" for "users", where each user has
folders "a", "b" and "c". Also every note has "read" status
Original thought was to create bucket "notifications" which will have the
key user_id, and the value will be JSON object in some structure like this:
{   
   user_id: "3ds78df7df8d7f8df7",
   folder: "a",
   read: 0,
   note: "my note here",
   timestamp: 18298329329
}
I am using Riak Search, so say, if I need to find all unread notes in folder
"a" for user_id "3ds78df7df8d7f8df7" I am doing:

select?q=..

user_id:3ds78df7df8d7f8df7 AND read:0

This works ugly slow -- takes about 12 secs for my case with only 5mln of
records bringing 5 results back.
My next idea was to create buckets per every user. Say user
"3ds78df7df8d7f8df7" will get bucket: "3ds78df7df8d7f8df7_notes" and we
search within it, which should be faster.

Please advise!

--
View this message in context: http://riak-users.197444.n3.nabble.com/Millions-of-buckets-tp2928567p2928567.html
Sent from the Riak Users mailing list archive at Nabble.com.



More information about the riak-users mailing list