Satya, Apologies, I mis-read your second option and thought all messages were to be put into a single value in a single bucket (which obviously doesn't make sense).
Using a single bucket for messages with per-user keys will work for you, as that single bucket can be indexed by 2i or Search (or Yokozuna if you're checking out 2.0) if necessary. -- Luke Bakken CSE [email protected] On Tue, Feb 4, 2014 at 6:31 AM, Luke Bakken <[email protected]> wrote: > Satya, > > In general, you always want to be querying Riak using a specific key value > to retrieve or update a specific value. Following this guideline, method > one is the correct data design. Please ensure that the default bucket > properties apply to all of these buckets as you do not want to have any > custom properties for such a large number of buckets. > > Method two will result in slow performance and most likely an object size > exceeding the recommended 1MB value. > > -- > Luke Bakken > CSE > [email protected] > > > On Tue, Feb 4, 2014 at 4:58 AM, Satya Ranjan <[email protected]>wrote: > >> Hi Riak experts, >> >> I am designing a simple message box feature for a web application using >> riak where an user can send messages to other registered users. So each >> user will have a Inbox and Outbox just like an email system. >> >> Also users can search messages in their message box. Here I am providing >> two different data model design. Could you please let me know if it makes >> sense. >> >> 1) Each user will have a separate bucket for their messages. So user u1 >> will have a bucket u1_messages and u2 will have u2_messages. All messages >> for an user will be added to his/her bucket. This will simplify search >> operation as the search operation will only operate on user's bucket. >> >> With this approach there will be lot many buckets in riak. So for 10000 >> registered users, there will be 10000 buckets. >> >> So does this approach makes sense ? Is there any limitation or drawback >> when there are too many buckets in riak ? >> >> 2) Common message bucket for all the users. The messages in the bucket >> will be tagged with the user id. So one big bucket for all the messages. >> Search operation will operate on that big bucket. >> >> Please suggest which of the above approach makes sense. I would really >> appreciate any help on this. >> >> Thanks for your help. >> >> Cheers, >> Satya >> >> >> >> >> >> _______________________________________________ >> riak-users mailing list >> [email protected] >> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com >> >> >
_______________________________________________ riak-users mailing list [email protected] http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
