cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "R. Verlangen" <ro...@us2.nl>
Subject Re: Schema advice/help
Date Tue, 27 Mar 2012 08:57:07 GMT
You can just get a slice range with as start "userId:" and no end.

2012/3/27 Maciej Miklas <mac.miklas@googlemail.com>

> multiget would require Order Preserving Partitioner, and this can lead to
> unbalanced ring and hot spots.
>
> Maybe you can use secondary index on "itemtype" - is must have small
> cardinality:
> http://pkghosh.wordpress.com/2011/03/02/cassandra-secondary-index-patterns/
>
>
>
>
> On Tue, Mar 27, 2012 at 10:10 AM, Guy Incognito <dnd1066@gmail.com> wrote:
>
>> without the ability to do disjoint column slices, i would probably use 5
>> different rows.
>>
>> userId:itemType -> activityId
>>
>> then it's a multiget slice of 10 items from each of your 5 rows.
>>
>>
>> On 26/03/2012 22:16, Ertio Lew wrote:
>>
>>> I need to store activities by each user, on 5 items types. I always want
>>> to read last 10 activities on each item type, by a user (ie, total
>>> activities to read at a time =50).
>>>
>>> I am wanting to store these activities in a single row for each user so
>>> that they can be retrieved in single row query, since I want to read all
>>> the last 10 activities on each item.. I am thinking of creating composite
>>> names appending "itemtype" : "activityId"(activityId is just timestamp
>>> value) but then, I don't see about how to read the last 10 activities from
>>> all itemtypes.
>>>
>>> Any ideas about schema to do this better way ?
>>>
>>
>>
>


-- 
With kind regards,

Robin Verlangen
www.robinverlangen.nl

Mime
View raw message