cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rauan Maemirov <ra...@maemirov.com>
Subject Re: Data model for activity feed
Date Mon, 21 Feb 2011 12:50:31 GMT
Any advices? Maybe I should group events from application? Wouldn't it be to
much overhead?

2011/2/19 Rauan Maemirov <rauan@maemirov.com>

> Hi, with the help of twissandra example, I tried to create a scheme for
> activity feed.
>
> Activities cf stores all activities:
>
> Activities: {
>   '4d5fbfdf47878': {
>     'user': 'larry',
>     'activity_type': 'comment',
>     ...
>     activity info
>   }
> }
>
> And userfeed cf stores each user's feed sorted by timestamp:
>
> Userfeed: {
>   'larry': {
>     1298120671317982: '4d5fbfdf47878',
>     1298120671392978: '4d5fbfdf5ff12',
>     1298120671417977: '4d5fbfdf660b9',
>     1298120671517972: '4d5fbfdf7e754',
>     1298120671542971: '4d5fbfdf848fb'
>   }
> }
>
> That was simple. Now I want to group all similar activities by some little
> time period (like it works in facebook and so on). The idea is to find
> latest activity from user by activity_type and move it to the new activity
> (in other words, merge activities and update timestamp). So it will be
> something like:
>
> Userfeed: {
>   'larry': {
>     1298120671317982: '4d5fbfdf47878',
>     1298120671417977: '["4d5fbfdf660b9", "4d5fbfdf5ff12"]', //json encoded
> array of activities
>     1298120671517972: '4d5fbfdf7e754',
>     1298120671542971: '["4d5fbfdf848fb", "4d5fbfdfd3e74"]'
>   }
> }
>
> Is it okay? Maybe somebody did this more elegant way.
> Maybe I should one more intermediate cf for grouped events?
>
> The other problem is that here I can say that "Larry commented item1, item2
> and item3", but how can be done "Larry, Curly and Hermes commented item1"?
>
>

Mime
View raw message