incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Ellis <jbel...@gmail.com>
Subject Re: Best practice with Column
Date Tue, 08 Dec 2009 14:30:13 GMT
If you only ever want to query contact/info/address separately, then
putting them in a single row has no benefit.

Even if you want to do it all at once, there's not much reason to use
a SC when all your column names are known ahead of time.  You could
use get_slice with a range to grab all user data, and get_slice with
explicitly enumerated  columns to pick out just the Contact data, for
instance.

-Jonathan

On Tue, Dec 8, 2009 at 1:42 AM, JKnight JKnight <beuknight@gmail.com> wrote:
> Dear all,
>
> I have a lot data with the same key.
> Ex,
> Contact{
>     userId{
>         "tel":...,
>         "phone": ...
>     }
>
> Info{
>     userId{
>         "birthday": ...,
>         "sex":...,
>         "nationality": ...
>     }
> }
>
> Address{
>     userId{
>         "street": ...,
>         "address": ...,
>         "city": ...,
>         "province": ...
>     }
> }
>
> We have 2 way to design Data data model:
> 1- Use 3 Column Family
> <ColumnFamily CompareWith="" Name="Contact"/>
> <ColumnFamily CompareWith="" Name="Address"/>
> <ColumnFamily CompareWith="" Name="Info"/>
>
> 2- Use 1 super Column Family:
> <ColumnFamily CompareWith="" Name="User" ColumnType="Super"
> CompareSubcolumnWidth=""/>
>
> Which one is better?
>
> Thank a lot for support.
> --
> Best regards,
> JKnight
>

Mime
View raw message