You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Robert <ke...@gmail.com> on 2010/04/23 22:32:37 UTC

Super and Regular Columns

I am starting out with Cassandra and I had a couple of questions, I read a
lot of the documentation including:

http://arin.me/blog/wtf-is-a-supercolumn-cassandra-data-model

First I wanted to make sure I understand this bug:
http://issues.apache.org/jira/browse/CASSANDRA-598

Borrowing from the the example provided in that article, would an example
subcolumn be 'friend1' or 'street'?

AddressBook = { // this is a ColumnFamily of type Super
    phatduckk: {    // this is the key to this row inside the Super CF
        friend1: {street: "8th street", zip: "90210", city: "Beverley
Hills", state: "CA"},
    }, // end row
    ieure: {     // this is the key to another row in the Super CF
        // all the address book entries for ieure
        joey: {street: "A ave", zip: "55485", city: "Hell", state: "NV"},
        William: {street: "Armpit Dr", zip: "93301", city:
"Bakersfield", state: "CA"},
    },
}

Second, for a one to many map where ordering is not important what are
the tradeoffs between these two options?

A. Use a ColumnFamily where the key maps to an item id, and in each
row each column is one of the items it is mapped to?

B. Use SuperColumnFamily where each key is an item id, and each column
(are these the right terms?) is one of the items it is mapped to, and
the value is essentially empty?

Thanks!
Robert Scott

Re: Super and Regular Columns

Posted by Jonathan Ellis <jb...@gmail.com>.
On Fri, Apr 23, 2010 at 3:32 PM, Robert <ke...@gmail.com> wrote:
> I am starting out with Cassandra and I had a couple of questions, I read a
> lot of the documentation including:
> http://arin.me/blog/wtf-is-a-supercolumn-cassandra-data-model
> First I wanted to make sure I understand this
> bug: http://issues.apache.org/jira/browse/CASSANDRA-598
> Borrowing from the the example provided in that article, would an example
> subcolumn be 'friend1' or 'street'?

friend1 is the name a a supercolumn; street is the name of a subcolumn

> Second, for a one to many map where ordering is not important what are the
> tradeoffs between these two options?
>
> A. Use a ColumnFamily where the key maps to an item id, and in each row each
> column is one of the items it is mapped to?
>
> B. Use SuperColumnFamily where each key is an item id, and each column (are
> these the right terms?) is one of the items it is mapped to, and the value
> is essentially empty?

I don't see what using supercolumns gives you here, so don't use them. :)

-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support
http://riptano.com