cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jian Fang <jian.fang.subscr...@gmail.com>
Subject Re: Cassandra 0.8 questions
Date Tue, 24 May 2011 17:24:54 GMT
Does anyone have a good suggestion on my second question? I believe that
question is a pretty common one.

My third question is a design question. For the same data, we can stored
them into multiple column families or a single column family with multiple
super columns.
>From Cassandra read/write performance point of view, what are the general
rules to make mutliple column families and when to use a single column
family?

Thanks again,

John

On Mon, May 23, 2011 at 5:47 PM, Jian Fang <jian.fang.subscribe@gmail.com>wrote:

> Hi,
>
> I am pretty new to Cassandra and am going to use Cassandra 0.8.0. I have
> two questions (sorry if they are very basic ones):
>
> 1) I have a column family to hold many super columns, say 30. When I first
> insert the data to the column family, do I need to insert each column one at
> a time or can I insert the whole column family in one transaction (or
> call?)? The latter one seems to be more efficient to me. Does Cassandra
> support that?
>
> For example, I saw the following code to do insertion (with Hector),
>
> Mutator m = HFactory.createMutator(keyspace, stringSerializer);
>                 //Mutator<String> m =
> HFactory.createMutator(keyspace,stringSerializer);
>                 m.insert(p.getCassandraKey(), colFamily,
>                         HFactory.createStringColumn("type",
> p.getStringValue()));
>                 m.insert(p.getCassandraKey(), colFamily,
>                         HFactory.createColumn("data", p.getCompressedXML(),
> StringSerializer.get(),
>                                 BytesArraySerializer.get()));
>
> Will the insertions be two separate calls to Cassandra? Or they are just
> one transaction? If it is the former case, is there any way to make them as
> one call to Cassandra?
>
> 2) How to store a list/array of data in Cassandra? For example, I have a
> data field called categories, which include none or many categories and each
> category includes a category id and a category description. Usually, how do
> people handle this scenario when they use Cassandra?
>
> Thanks in advance,
>
> John
>

Mime
View raw message