Hi Bogunov, Thank you for your fast answer.
If I understand correctly your though, for every insert, I should retrieve the list of message, append a new message and then store the list again ? If it is, doesn't it performance eating ? retrieve a whole list (that can be long if the user has not connected since a long time) append a new message and store it ? there is 2 operations just for storing… Or is there a way to append data directly on a key ? Best regards, Le 9 mai 2012 à 22:16, Bogunov a écrit : > Hi, morgan. > > - Store from 1 to X messages per registered user. > Store all messages as one key. > Get the number of stored messages per user. (may be stored on a variable) > yes > retrieve all messages from an user at once. > get one key =) > delete all messages from an user at once. > delete one key > delete all messages that are older than X months no matter the user > you can store index entry like "written in X, X1 month" and find all users > who has old messages and truncate them > > Is it realistic to have a bucket per user ? > - bucket is prefix, for bucket you keep your default preferences: R/W/N, > post/pre-commit hooks, etc. Not much gain in doing so. > > > On Wed, May 9, 2012 at 11:51 PM, Morgan Segalis <msega...@gmail.com> wrote: > Hi everyone ! > > I have followed with interest the riak evolution. > > I have a chat server written in Erlang from scratch with my own protocol. > Right now I'm using MySQL in order to store Users credentials and friend list. > > I'm using Cassandra via thrift to store message that an offline user has got, > until the user retrieves it. > > My Cassandra data model, is quite simple, a Column Family, each row is an > user, each column is a message (title = timestamp for getting time ordered > data, value = message). > > The thing is, despite the fact that I'm happy with Cassandra performance and > TimeToLive feature, I would like to avoid the hassle of thrift to update my > code. > > Since Riak is (As I have seen on multiple website) the closer thing to > cassandra (but simpler). > > However Riak paradigm seems to be different somehow, with bucket which I'm > not yet familiar with. > > Before getting to know Riak better I would like to have some expert opinion > on the matter. > > I need to do several things : > > - Store from 1 to X messages per registered user. > - Get the number of stored messages per user. (may be stored on a variable) > - retrieve all messages from an user at once. > - delete all messages from an user at once. > - delete all messages that are older than X months no matter the user > > I would really love your opinion on, is Riak fit my needs, and if so, what > would be the data model ? > Is it realistic to have a bucket per user ? > > Best regards, > > > > _______________________________________________ > riak-users mailing list > riak-users@lists.basho.com > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com > > > > -- > email: bogu...@gmail.com > skype: i.bogunov > phone: +7 903 131 8499 > Regards, Bogunov Ilya > >
_______________________________________________ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com