Hi,

I want to inquire about feasibility of using riak for logging chat
messages. My architecture is as follows: There are multiple sites where a
user can either send message to another user or to a room (on the same
site), and these messages need to be logged. Is riak a good fit for this
use case?

I intend to make an inbox where users would be able to view all their
conversations (with other users or in a specific room per site). The users
would have ability to view messages via pagination starting with the most
recent message being listed first i.e. last 50 messages, and then next last
50, and so on.

I was planning to create a bucket for every pair of user (who chat) and
every room per site. The user base of these sites is huge, and would grow
with time, and also new sites would join in with time. So, the number of
buckets would increase at a very fast pace. Is this going to be a problem?

Now, each bucket would have conversation between two users or of a room of
a site. The conversation rate for (some) rooms is very high, some 20,000 -
30,000 messages per hour. We have observed that users usually don't access
conversations past one week. So, if a bucket has conversation of 3 years,
then mostly users would access the recent conversation upto a week or
month. Can riak handle this easily? Also, would riak use RAM wisely in this
scenario? Would it only keep keys and indexes, corresponding to recent
messages per bucket, in RAM?

Finally, what is the best approach for creating keys in a bucket? Earlier,
I was planning to use timestamp (in milliseconds). But in a room there can
be multiple messages at the same time. As I understand I cannot have
a unique incremental message id per bucket (as riak has write capability in
all nodes in a cluster so consistency is not guareented). Please correct me
if I am wrong. One other way could be to let riak generate key and I use
timestamp as a secondary index. But this seems to be a bad design. Also,
what would be the best way to achieve pagination for this use case?

Please do let me know if this can be implemented in a altogether different
and better manner.

Thanks,
Shashwat
_______________________________________________
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to