incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Holstad <erikhols...@gmail.com>
Subject Re: Model to store biggest score
Date Thu, 18 Mar 2010 14:12:57 GMT
Another approach you can take is to add the userid to the score like,
=> (column=140_uid2, value=[], timestamp=1268841641979)
and f you need the score time sorted you can add
=> (column=140_268841641979_uid2, value=[], timestamp=1268841641979)

But I do think that in any case you need to remove the old entry so that you
don't
get duplicates, unless I'm missing something here.


On Wed, Mar 17, 2010 at 9:52 AM, Brandon Williams <driftx@gmail.com> wrote:

> On Wed, Mar 17, 2010 at 11:48 AM, Richard Grossman <richiesgr@gmail.com>wrote:
>
>> But in the case of simple column family I've the same problem when I
>> update the score of 1 user then I need to remove his old score too. For
>> example here the user uid5 was at 130 now he is at 140 because I add the
>> random number cassandra will keep all the score evolution.
>>
>
> You can maintain another index mapping users to the values.  Depending on
> your use case though, if this is time-based, you can name the rows by the
> date and just create new rows as time goes on.
>
> -Brandon
>



-- 
Regards Erik

Mime
View raw message