You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Joe Greenawalt <jo...@gmail.com> on 2013/06/06 15:02:53 UTC

Dynamic Columns Question Cassandra 1.2.5, Datastax Java Driver 1.0

Hi,
I'm having some problems figuring out how to append a dynamic column on a
column family using the datastax java driver 1.0 and CQL3 on Cassandra
1.2.5.  Below is what i'm trying:

*cqlsh:simplex> create table user (firstname text primary key, lastname
text);
cqlsh:simplex> insert into user (firstname, lastname) values
('joe','shmoe');
cqlsh:simplex> select * from user;

 firstname | lastname
-----------+----------
       joe |    shmoe

cqlsh:simplex> insert into user (firstname, lastname, middlename) values
('joe','shmoe','lester');
Bad Request: Unknown identifier middlename
cqlsh:simplex> insert into user (firstname, lastname, middlename) values
('john','shmoe','lester');
Bad Request: Unknown identifier middlename*

I'm assuming you can do this based on previous based thrift based clients
like pycassa, and also by reading this:

The Cassandra data model is a dynamic schema, column-oriented data model.
This means that, unlike a relational database, you do not need to model all
of the columns required by your application up front, as each row is not
required to have the same set of columns. Columns and their metadata can be
added by your application as they are needed without incurring downtime to
your application.
here: http://www.datastax.com/docs/1.2/ddl/index

Is it a limitation of CQL3 and its connection vs. thrift?
Or more likely i'm just doing something wrong?

Thanks,
Joe

Re: Dynamic Columns Question Cassandra 1.2.5, Datastax Java Driver 1.0

Posted by Eric Stevens <mi...@gmail.com>.
Your data model should take into consideration the number of items you're
storing in a collection.  If you expect it will grow over time with no
small upper bound, don't use a collection.  You don't need to read before
write to answer this question, it's a decision made at modeling time
(before you ever write your very first record).

If the possible values are finite and small, use a collection.  Otherwise
normalize.

Over time if you find your collections are getting large, then either an
assumption changed or you modeled poorly.  Either way it's time to refactor.

DON'T STORE MORE THEN 100 THINGS IN A COLLECTION
>

Actually that's probably a bit too hard edged.  You could easily have a
Set<Int> whose typical size is 1000.  If the data doesn't change often, and
you always need to know all those values at the same time as each other,
there's actually no problem with this.  Constantly mutating values are a
problem as the collection gets large, or cases where you need to know only
a subset of the the collection at a time.

-Eric Stevens
ProtectWise, Inc.


On Thu, Jun 6, 2013 at 10:59 AM, Edward Capriolo <ed...@gmail.com>wrote:

> The problem about "being careful about how much you store in a collection"
> is that Cassandra is a blind-write system. Knowing how much data is
> currently in the collection before you write is an anti-pattern, read
> before write.
>
> Cassandra Rule 1: DON'T READ BEFORE WRITE
> Cassandra Rule 2: ROWS CAN HAVE 2 BILLION COLUMNS
> Collection Rule 1: DON'T STORE MORE THEN 100 THINGS IN A COLLECTION
>
> Why does are user confused? Its simple.
>
>
>
>
>
>
>
>
>
> On Thu, Jun 6, 2013 at 10:51 AM, Eric Stevens <mi...@gmail.com> wrote:
>
>>  CQL3 does now support dynamic columns. For tags or metadata values you
>>> could use a Collection:
>>>
>>
>> This should probably be clarified.  A collection is a super useful tool,
>> but it is *not* the same thing as a dynamic column.  It has many
>> advantages, but there is one huge disadvantage in that you have to be
>> careful how much data you store in a collection. When you read a single
>> value out of a collection, the *entire* collection is always read, which
>> of course is true for appending data to the collection as well.
>>
>> With a traditional dynamic column, you could have added things like event
>> logs to a record in the form of keys named "event:someEvent:TS" (or
>> juxtapose the order as your needs dictate).  You could basically do this
>> practically indefinitely with little degradation in performance.  This was
>> also a common way of representing cross-family relationships (one-to-many
>> style).
>>
>> If you try to do the same thing with a collection, performance will
>> degrade as your data grows.  For small or relatively static data sets (eg
>> tags) that's fine.  For open-ended data sets (logs, events, one-to-many
>> relationships that grow regularly), you should instead normalize such data
>> into a separate column family.
>>
>> -Eric Stevens
>> ProtectWise, Inc.
>>
>>
>> On Thu, Jun 6, 2013 at 9:49 AM, Francisco Andrades Grassi <
>> bigjocker@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> CQL3 does now support dynamic columns. For tags or metadata values you
>>> could use a Collection:
>>>
>>> http://www.datastax.com/dev/blog/cql3_collections
>>>
>>> For wide rows there's the enhanced primary keys, which I personally
>>> prefer over the composite columns of yore:
>>>
>>> http://www.datastax.com/dev/blog/cql3-for-cassandra-experts
>>> http://thelastpickle.com/2013/01/11/primary-keys-in-cql/
>>>
>>> --
>>> Francisco Andrades Grassi
>>> www.bigjocker.com
>>> @bigjocker
>>>
>>> On Jun 6, 2013, at 8:32 AM, Joe Greenawalt <jo...@gmail.com>
>>> wrote:
>>>
>>> Hi,
>>> I'm having some problems figuring out how to append a dynamic column on
>>> a column family using the datastax java driver 1.0 and CQL3 on Cassandra
>>> 1.2.5.  Below is what i'm trying:
>>>
>>> *cqlsh:simplex> create table user (firstname text primary key, lastname
>>> text);
>>> cqlsh:simplex> insert into user (firstname, lastname) values
>>> ('joe','shmoe');
>>> cqlsh:simplex> select * from user;
>>>
>>>  firstname | lastname
>>> -----------+----------
>>>        joe |    shmoe
>>>
>>> cqlsh:simplex> insert into user (firstname, lastname, middlename) values
>>> ('joe','shmoe','lester');
>>> Bad Request: Unknown identifier middlename
>>> cqlsh:simplex> insert into user (firstname, lastname, middlename) values
>>> ('john','shmoe','lester');
>>> Bad Request: Unknown identifier middlename*
>>>
>>> I'm assuming you can do this based on previous based thrift based
>>> clients like pycassa, and also by reading this:
>>>
>>> The Cassandra data model is a dynamic schema, column-oriented data
>>> model. This means that, unlike a relational database, you do not need to
>>> model all of the columns required by your application up front, as each row
>>> is not required to have the same set of columns. Columns and their metadata
>>> can be added by your application as they are needed without incurring
>>> downtime to your application.
>>> here: http://www.datastax.com/docs/1.2/ddl/index
>>>
>>> Is it a limitation of CQL3 and its connection vs. thrift?
>>> Or more likely i'm just doing something wrong?
>>>
>>> Thanks,
>>> Joe
>>>
>>>
>>>
>>
>

Re: Dynamic Columns Question Cassandra 1.2.5, Datastax Java Driver 1.0

Posted by Edward Capriolo <ed...@gmail.com>.
The problem about "being careful about how much you store in a collection"
is that Cassandra is a blind-write system. Knowing how much data is
currently in the collection before you write is an anti-pattern, read
before write.

Cassandra Rule 1: DON'T READ BEFORE WRITE
Cassandra Rule 2: ROWS CAN HAVE 2 BILLION COLUMNS
Collection Rule 1: DON'T STORE MORE THEN 100 THINGS IN A COLLECTION

Why does are user confused? Its simple.









On Thu, Jun 6, 2013 at 10:51 AM, Eric Stevens <mi...@gmail.com> wrote:

> CQL3 does now support dynamic columns. For tags or metadata values you
>> could use a Collection:
>>
>
> This should probably be clarified.  A collection is a super useful tool,
> but it is *not* the same thing as a dynamic column.  It has many
> advantages, but there is one huge disadvantage in that you have to be
> careful how much data you store in a collection. When you read a single
> value out of a collection, the *entire* collection is always read, which
> of course is true for appending data to the collection as well.
>
> With a traditional dynamic column, you could have added things like event
> logs to a record in the form of keys named "event:someEvent:TS" (or
> juxtapose the order as your needs dictate).  You could basically do this
> practically indefinitely with little degradation in performance.  This was
> also a common way of representing cross-family relationships (one-to-many
> style).
>
> If you try to do the same thing with a collection, performance will
> degrade as your data grows.  For small or relatively static data sets (eg
> tags) that's fine.  For open-ended data sets (logs, events, one-to-many
> relationships that grow regularly), you should instead normalize such data
> into a separate column family.
>
> -Eric Stevens
> ProtectWise, Inc.
>
>
> On Thu, Jun 6, 2013 at 9:49 AM, Francisco Andrades Grassi <
> bigjocker@gmail.com> wrote:
>
>> Hi,
>>
>> CQL3 does now support dynamic columns. For tags or metadata values you
>> could use a Collection:
>>
>> http://www.datastax.com/dev/blog/cql3_collections
>>
>> For wide rows there's the enhanced primary keys, which I personally
>> prefer over the composite columns of yore:
>>
>> http://www.datastax.com/dev/blog/cql3-for-cassandra-experts
>> http://thelastpickle.com/2013/01/11/primary-keys-in-cql/
>>
>> --
>> Francisco Andrades Grassi
>> www.bigjocker.com
>> @bigjocker
>>
>> On Jun 6, 2013, at 8:32 AM, Joe Greenawalt <jo...@gmail.com>
>> wrote:
>>
>> Hi,
>> I'm having some problems figuring out how to append a dynamic column on a
>> column family using the datastax java driver 1.0 and CQL3 on Cassandra
>> 1.2.5.  Below is what i'm trying:
>>
>> *cqlsh:simplex> create table user (firstname text primary key, lastname
>> text);
>> cqlsh:simplex> insert into user (firstname, lastname) values
>> ('joe','shmoe');
>> cqlsh:simplex> select * from user;
>>
>>  firstname | lastname
>> -----------+----------
>>        joe |    shmoe
>>
>> cqlsh:simplex> insert into user (firstname, lastname, middlename) values
>> ('joe','shmoe','lester');
>> Bad Request: Unknown identifier middlename
>> cqlsh:simplex> insert into user (firstname, lastname, middlename) values
>> ('john','shmoe','lester');
>> Bad Request: Unknown identifier middlename*
>>
>> I'm assuming you can do this based on previous based thrift based clients
>> like pycassa, and also by reading this:
>>
>> The Cassandra data model is a dynamic schema, column-oriented data model.
>> This means that, unlike a relational database, you do not need to model all
>> of the columns required by your application up front, as each row is not
>> required to have the same set of columns. Columns and their metadata can be
>> added by your application as they are needed without incurring downtime to
>> your application.
>> here: http://www.datastax.com/docs/1.2/ddl/index
>>
>> Is it a limitation of CQL3 and its connection vs. thrift?
>> Or more likely i'm just doing something wrong?
>>
>> Thanks,
>> Joe
>>
>>
>>
>

Re: Dynamic Columns Question Cassandra 1.2.5, Datastax Java Driver 1.0

Posted by Eric Stevens <mi...@gmail.com>.
>
> CQL3 does now support dynamic columns. For tags or metadata values you
> could use a Collection:
>

This should probably be clarified.  A collection is a super useful tool,
but it is *not* the same thing as a dynamic column.  It has many
advantages, but there is one huge disadvantage in that you have to be
careful how much data you store in a collection. When you read a single
value out of a collection, the *entire* collection is always read, which of
course is true for appending data to the collection as well.

With a traditional dynamic column, you could have added things like event
logs to a record in the form of keys named "event:someEvent:TS" (or
juxtapose the order as your needs dictate).  You could basically do this
practically indefinitely with little degradation in performance.  This was
also a common way of representing cross-family relationships (one-to-many
style).

If you try to do the same thing with a collection, performance will degrade
as your data grows.  For small or relatively static data sets (eg tags)
that's fine.  For open-ended data sets (logs, events, one-to-many
relationships that grow regularly), you should instead normalize such data
into a separate column family.

-Eric Stevens
ProtectWise, Inc.


On Thu, Jun 6, 2013 at 9:49 AM, Francisco Andrades Grassi <
bigjocker@gmail.com> wrote:

> Hi,
>
> CQL3 does now support dynamic columns. For tags or metadata values you
> could use a Collection:
>
> http://www.datastax.com/dev/blog/cql3_collections
>
> For wide rows there's the enhanced primary keys, which I personally prefer
> over the composite columns of yore:
>
> http://www.datastax.com/dev/blog/cql3-for-cassandra-experts
> http://thelastpickle.com/2013/01/11/primary-keys-in-cql/
>
> --
> Francisco Andrades Grassi
> www.bigjocker.com
> @bigjocker
>
> On Jun 6, 2013, at 8:32 AM, Joe Greenawalt <jo...@gmail.com>
> wrote:
>
> Hi,
> I'm having some problems figuring out how to append a dynamic column on a
> column family using the datastax java driver 1.0 and CQL3 on Cassandra
> 1.2.5.  Below is what i'm trying:
>
> *cqlsh:simplex> create table user (firstname text primary key, lastname
> text);
> cqlsh:simplex> insert into user (firstname, lastname) values
> ('joe','shmoe');
> cqlsh:simplex> select * from user;
>
>  firstname | lastname
> -----------+----------
>        joe |    shmoe
>
> cqlsh:simplex> insert into user (firstname, lastname, middlename) values
> ('joe','shmoe','lester');
> Bad Request: Unknown identifier middlename
> cqlsh:simplex> insert into user (firstname, lastname, middlename) values
> ('john','shmoe','lester');
> Bad Request: Unknown identifier middlename*
>
> I'm assuming you can do this based on previous based thrift based clients
> like pycassa, and also by reading this:
>
> The Cassandra data model is a dynamic schema, column-oriented data model.
> This means that, unlike a relational database, you do not need to model all
> of the columns required by your application up front, as each row is not
> required to have the same set of columns. Columns and their metadata can be
> added by your application as they are needed without incurring downtime to
> your application.
> here: http://www.datastax.com/docs/1.2/ddl/index
>
> Is it a limitation of CQL3 and its connection vs. thrift?
> Or more likely i'm just doing something wrong?
>
> Thanks,
> Joe
>
>
>

Re: Dynamic Columns Question Cassandra 1.2.5, Datastax Java Driver 1.0

Posted by Francisco Andrades Grassi <bi...@gmail.com>.
Hi,

CQL3 does now support dynamic columns. For tags or metadata values you could use a Collection:

http://www.datastax.com/dev/blog/cql3_collections

For wide rows there's the enhanced primary keys, which I personally prefer over the composite columns of yore:

http://www.datastax.com/dev/blog/cql3-for-cassandra-experts
http://thelastpickle.com/2013/01/11/primary-keys-in-cql/

--
Francisco Andrades Grassi
www.bigjocker.com
@bigjocker

On Jun 6, 2013, at 8:32 AM, Joe Greenawalt <jo...@gmail.com> wrote:

> Hi, 
> I'm having some problems figuring out how to append a dynamic column on a column family using the datastax java driver 1.0 and CQL3 on Cassandra 1.2.5.  Below is what i'm trying:
> 
> cqlsh:simplex> create table user (firstname text primary key, lastname text);
> cqlsh:simplex> insert into user (firstname, lastname) values ('joe','shmoe');
> cqlsh:simplex> select * from user;
> 
>  firstname | lastname
> -----------+----------
>        joe |    shmoe
> 
> cqlsh:simplex> insert into user (firstname, lastname, middlename) values ('joe','shmoe','lester');
> Bad Request: Unknown identifier middlename
> cqlsh:simplex> insert into user (firstname, lastname, middlename) values ('john','shmoe','lester');
> Bad Request: Unknown identifier middlename
> 
> I'm assuming you can do this based on previous based thrift based clients like pycassa, and also by reading this:
> The Cassandra data model is a dynamic schema, column-oriented data model. This means that, unlike a relational database, you do not need to model all of the columns required by your application up front, as each row is not required to have the same set of columns. Columns and their metadata can be added by your application as they are needed without  incurring downtime to your application.
> 
> here: http://www.datastax.com/docs/1.2/ddl/index
> 
> Is it a limitation of CQL3 and its connection vs. thrift? 
> Or more likely i'm just doing something wrong?
> 
> Thanks,
> Joe


Re: Dynamic Columns Question Cassandra 1.2.5, Datastax Java Driver 1.0

Posted by Shahab Yunus <sh...@gmail.com>.
Dynamic columns are not supported in CQL3. We just had a discussion a day
or two ago about this where Eric Stevens explained it. Please see this:
http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/CQL-3-returning-duplicate-keys-td7588181.html

Regards,
Shahab


On Thu, Jun 6, 2013 at 9:02 AM, Joe Greenawalt <jo...@gmail.com>wrote:

> Hi,
> I'm having some problems figuring out how to append a dynamic column on a
> column family using the datastax java driver 1.0 and CQL3 on Cassandra
> 1.2.5.  Below is what i'm trying:
>
> *cqlsh:simplex> create table user (firstname text primary key, lastname
> text);
> cqlsh:simplex> insert into user (firstname, lastname) values
> ('joe','shmoe');
> cqlsh:simplex> select * from user;
>
>  firstname | lastname
> -----------+----------
>        joe |    shmoe
>
> cqlsh:simplex> insert into user (firstname, lastname, middlename) values
> ('joe','shmoe','lester');
> Bad Request: Unknown identifier middlename
> cqlsh:simplex> insert into user (firstname, lastname, middlename) values
> ('john','shmoe','lester');
> Bad Request: Unknown identifier middlename*
>
> I'm assuming you can do this based on previous based thrift based clients
> like pycassa, and also by reading this:
>
> The Cassandra data model is a dynamic schema, column-oriented data model.
> This means that, unlike a relational database, you do not need to model all
> of the columns required by your application up front, as each row is not
> required to have the same set of columns. Columns and their metadata can be
> added by your application as they are needed without incurring downtime to
> your application.
> here: http://www.datastax.com/docs/1.2/ddl/index
>
> Is it a limitation of CQL3 and its connection vs. thrift?
> Or more likely i'm just doing something wrong?
>
> Thanks,
> Joe
>

RE: [Cassandra] Conflict resolution in Cassandra

Posted by Viktor Jevdokimov <Vi...@adform.com>.
Define a conflict. What kind  of conflict you are talking about?

There're no transactions. For simple inserts/updates latest column timestamp wins. Timestamp is provided by application.

Counter columns has some conflict resolution, but overall counter columns not working perfect.




From: Emalayan Vairavanathan [mailto:svemalayan@yahoo.com]
Sent: Thursday, June 6, 2013 9:23 PM
To: user@cassandra.apache.org
Subject: [Cassandra] Conflict resolution in Cassandra

Hi All,

Can someone tell me about the conflict resolution mechanisms provided by Cassandra?

More specifically does Cassandra provides a way to define application specific conflict resolution mechanisms (per row basis  / column basis)?
           or
Does it automatically manage the conflicts based on some synchronization algorithms ?


Thank you
Emalayan


Best regards / Pagarbiai
Viktor Jevdokimov
Senior Developer

Email: Viktor.Jevdokimov@adform.com<ma...@adform.com>
Phone: +370 5 212 3063, Fax +370 5 261 0453
J. Jasinskio 16C, LT-01112 Vilnius, Lithuania
Follow us on Twitter: @adforminsider<http://twitter.com/#!/adforminsider>
Take a ride with Adform's Rich Media Suite<http://vimeo.com/adform/richmedia>

[Adform News] <http://www.adform.com>
[Adform awarded the Best Employer 2012] <http://www.adform.com/site/blog/adform/adform-takes-top-spot-in-best-employer-survey/>


Disclaimer: The information contained in this message and attachments is intended solely for the attention and use of the named addressee and may be confidential. If you are not the intended recipient, you are reminded that the information remains the property of the sender. You must not use, disclose, distribute, copy, print or rely on this e-mail. If you have received this message in error, please contact the sender immediately and irrevocably delete this message and any copies.


Re: [Cassandra] Conflict resolution in Cassandra

Posted by Theo Hultberg <th...@iconara.net>.
Like Edward says Cassandra's conflict resolution strategy is LWW (last
write wins). This may seem simplistic, but Cassandra's Big Query-esque data
model makes it less of an issue than in a pure key/value-store like Riak,
for example. When all you have is an opaque value for a key you want to be
able to do things like keeping conflicting writes so that you can resolve
them later. Since Cassandra's rows aren't opaque, but more like a sorted
map LWW is almost always enough. With Cassandra you can add new
columns/cells to a row from multiple clients without having to worry about
conflicts. It's only when multiple clients write to the same column/cell
that there is an issue, but in that case you usually can (and you probably
should) model your way around that.

T#


On Fri, Jun 7, 2013 at 4:51 PM, Edward Capriolo <ed...@gmail.com>wrote:

> Conflicts are managed at the column level.
> 1) If two columns have the same name the column with the highest timestamp
> wins.
> 2) If two columns have the same column name and the same timestamp the
> value of the column is compared and the highest* wins.
>
> Someone correct me if I am wrong about the *. I know the algorithm is
> deterministic, I do not remember if it is highest or lowest.
>
>
> On Thu, Jun 6, 2013 at 6:25 PM, Emalayan Vairavanathan <
> svemalayan@yahoo.com> wrote:
>
>> I tried google and found conflicting answers. Thats why wanted to double
>> check with user forum.
>>
>> Thanks
>>
>>   ------------------------------
>>  *From:* Bryan Talbot <bt...@aeriagames.com>
>> *To:* user@cassandra.apache.org; Emalayan Vairavanathan <
>> svemalayan@yahoo.com>
>> *Sent:* Thursday, 6 June 2013 3:19 PM
>> *Subject:* Re: [Cassandra] Conflict resolution in Cassandra
>>
>> For generic questions like this, google is your friend:
>> http://lmgtfy.com/?q=cassandra+conflict+resolution
>>
>> -Bryan
>>
>>
>> On Thu, Jun 6, 2013 at 11:23 AM, Emalayan Vairavanathan <
>> svemalayan@yahoo.com> wrote:
>>
>> Hi All,
>>
>> Can someone tell me about the conflict resolution mechanisms provided by
>> Cassandra?
>>
>> More specifically does Cassandra provides a way to define application
>> specific conflict resolution mechanisms (per row basis  / column basis)?
>>            or
>> Does it automatically manage the conflicts based on some synchronization
>> algorithms ?
>>
>>
>> Thank you
>> Emalayan
>>
>>
>>
>>
>>
>>
>

Re: [Cassandra] Conflict resolution in Cassandra

Posted by Edward Capriolo <ed...@gmail.com>.
Conflicts are managed at the column level.
1) If two columns have the same name the column with the highest timestamp
wins.
2) If two columns have the same column name and the same timestamp the
value of the column is compared and the highest* wins.

Someone correct me if I am wrong about the *. I know the algorithm is
deterministic, I do not remember if it is highest or lowest.


On Thu, Jun 6, 2013 at 6:25 PM, Emalayan Vairavanathan <svemalayan@yahoo.com
> wrote:

> I tried google and found conflicting answers. Thats why wanted to double
> check with user forum.
>
> Thanks
>
>   ------------------------------
>  *From:* Bryan Talbot <bt...@aeriagames.com>
> *To:* user@cassandra.apache.org; Emalayan Vairavanathan <
> svemalayan@yahoo.com>
> *Sent:* Thursday, 6 June 2013 3:19 PM
> *Subject:* Re: [Cassandra] Conflict resolution in Cassandra
>
> For generic questions like this, google is your friend:
> http://lmgtfy.com/?q=cassandra+conflict+resolution
>
> -Bryan
>
>
> On Thu, Jun 6, 2013 at 11:23 AM, Emalayan Vairavanathan <
> svemalayan@yahoo.com> wrote:
>
> Hi All,
>
> Can someone tell me about the conflict resolution mechanisms provided by
> Cassandra?
>
> More specifically does Cassandra provides a way to define application
> specific conflict resolution mechanisms (per row basis  / column basis)?
>            or
> Does it automatically manage the conflicts based on some synchronization
> algorithms ?
>
>
> Thank you
> Emalayan
>
>
>
>
>
>

Re: [Cassandra] Conflict resolution in Cassandra

Posted by Emalayan Vairavanathan <sv...@yahoo.com>.
I tried google and found conflicting answers. Thats why wanted to double check with user forum. 

Thanks


________________________________
 From: Bryan Talbot <bt...@aeriagames.com>
To: user@cassandra.apache.org; Emalayan Vairavanathan <sv...@yahoo.com> 
Sent: Thursday, 6 June 2013 3:19 PM
Subject: Re: [Cassandra] Conflict resolution in Cassandra
 


For generic questions like this, google is your friend: http://lmgtfy.com/?q=cassandra+conflict+resolution

-Bryan



On Thu, Jun 6, 2013 at 11:23 AM, Emalayan Vairavanathan <sv...@yahoo.com> wrote:

Hi All,
>
>
>Can someone tell me about the conflict resolution mechanisms provided by Cassandra?
>
>
>More specifically does Cassandra provides a way to define application specific conflict resolution mechanisms (per row basis  / column basis)? 
>           or 
>Does it automatically manage the conflicts based on some synchronization algorithms ?
>
>
>
>
>Thank youEmalayan
>
>
>
>

Re: [Cassandra] Conflict resolution in Cassandra

Posted by Bryan Talbot <bt...@aeriagames.com>.
For generic questions like this, google is your friend:
http://lmgtfy.com/?q=cassandra+conflict+resolution

-Bryan


On Thu, Jun 6, 2013 at 11:23 AM, Emalayan Vairavanathan <
svemalayan@yahoo.com> wrote:

> Hi All,
>
> Can someone tell me about the conflict resolution mechanisms provided by
> Cassandra?
>
> More specifically does Cassandra provides a way to define application
> specific conflict resolution mechanisms (per row basis  / column basis)?
>            or
> Does it automatically manage the conflicts based on some synchronization
> algorithms ?
>
>
> Thank you
> Emalayan
>
>
>

[Cassandra] Conflict resolution in Cassandra

Posted by Emalayan Vairavanathan <sv...@yahoo.com>.
Hi All,

Can someone tell me about the conflict resolution mechanisms provided by Cassandra?

More specifically does Cassandra provides a way to define application specific conflict resolution mechanisms (per row basis  / column basis)? 
           or 
Does it automatically manage the conflicts based on some synchronization algorithms ?


Thank you
Emalayan

Re: Dynamic Columns Question Cassandra 1.2.5, Datastax Java Driver 1.0

Posted by Joe Greenawalt <jo...@gmail.com>.
Hey, this is good info.  Seems like i have the same capabilities, i just
need to twist my brain a bit to see it better.  Thanks for all the
feedback, much appreciated.

Joe


On Thu, Jun 6, 2013 at 11:27 AM, Alain RODRIGUEZ <ar...@gmail.com> wrote:

> Not sure if you remember this Jonathan, but Sylvain already wrote a very
> clear documentation about it :
> http://www.datastax.com/dev/blog/thrift-to-cql3 (OCTOBER 26, 2012)
>
> Yet a second page will give to this important topic a greater visibility.
>
>
> 2013/6/6 Jonathan Ellis <jb...@gmail.com>
>
>> This is becoming something of a FAQ, so I wrote an more in-depth
>> answer:
>> http://www.datastax.com/dev/blog/does-cql-support-dynamic-columns-wide-rows
>>
>> On Thu, Jun 6, 2013 at 8:02 AM, Joe Greenawalt <jo...@gmail.com>
>> wrote:
>> > Hi,
>> > I'm having some problems figuring out how to append a dynamic column on
>> a
>> > column family using the datastax java driver 1.0 and CQL3 on Cassandra
>> > 1.2.5.  Below is what i'm trying:
>> >
>> > cqlsh:simplex> create table user (firstname text primary key, lastname
>> > text);
>> > cqlsh:simplex> insert into user (firstname, lastname) values
>> > ('joe','shmoe');
>> > cqlsh:simplex> select * from user;
>> >
>> >  firstname | lastname
>> > -----------+----------
>> >        joe |    shmoe
>> >
>> > cqlsh:simplex> insert into user (firstname, lastname, middlename) values
>> > ('joe','shmoe','lester');
>> > Bad Request: Unknown identifier middlename
>> > cqlsh:simplex> insert into user (firstname, lastname, middlename) values
>> > ('john','shmoe','lester');
>> > Bad Request: Unknown identifier middlename
>> >
>> > I'm assuming you can do this based on previous based thrift based
>> clients
>> > like pycassa, and also by reading this:
>> >
>> > The Cassandra data model is a dynamic schema, column-oriented data
>> model.
>> > This means that, unlike a relational database, you do not need to model
>> all
>> > of the columns required by your application up front, as each row is not
>> > required to have the same set of columns. Columns and their metadata
>> can be
>> > added by your application as they are needed without incurring downtime
>> to
>> > your application.
>> >
>> > here: http://www.datastax.com/docs/1.2/ddl/index
>> >
>> > Is it a limitation of CQL3 and its connection vs. thrift?
>> > Or more likely i'm just doing something wrong?
>> >
>> > Thanks,
>> > Joe
>>
>>
>>
>> --
>> Jonathan Ellis
>> Project Chair, Apache Cassandra
>> co-founder, http://www.datastax.com
>> @spyced
>>
>
>

Re: Dynamic Columns Question Cassandra 1.2.5, Datastax Java Driver 1.0

Posted by Alain RODRIGUEZ <ar...@gmail.com>.
Not sure if you remember this Jonathan, but Sylvain already wrote a very
clear documentation about it :
http://www.datastax.com/dev/blog/thrift-to-cql3 (OCTOBER 26, 2012)

Yet a second page will give to this important topic a greater visibility.


2013/6/6 Jonathan Ellis <jb...@gmail.com>

> This is becoming something of a FAQ, so I wrote an more in-depth
> answer:
> http://www.datastax.com/dev/blog/does-cql-support-dynamic-columns-wide-rows
>
> On Thu, Jun 6, 2013 at 8:02 AM, Joe Greenawalt <jo...@gmail.com>
> wrote:
> > Hi,
> > I'm having some problems figuring out how to append a dynamic column on a
> > column family using the datastax java driver 1.0 and CQL3 on Cassandra
> > 1.2.5.  Below is what i'm trying:
> >
> > cqlsh:simplex> create table user (firstname text primary key, lastname
> > text);
> > cqlsh:simplex> insert into user (firstname, lastname) values
> > ('joe','shmoe');
> > cqlsh:simplex> select * from user;
> >
> >  firstname | lastname
> > -----------+----------
> >        joe |    shmoe
> >
> > cqlsh:simplex> insert into user (firstname, lastname, middlename) values
> > ('joe','shmoe','lester');
> > Bad Request: Unknown identifier middlename
> > cqlsh:simplex> insert into user (firstname, lastname, middlename) values
> > ('john','shmoe','lester');
> > Bad Request: Unknown identifier middlename
> >
> > I'm assuming you can do this based on previous based thrift based clients
> > like pycassa, and also by reading this:
> >
> > The Cassandra data model is a dynamic schema, column-oriented data model.
> > This means that, unlike a relational database, you do not need to model
> all
> > of the columns required by your application up front, as each row is not
> > required to have the same set of columns. Columns and their metadata can
> be
> > added by your application as they are needed without incurring downtime
> to
> > your application.
> >
> > here: http://www.datastax.com/docs/1.2/ddl/index
> >
> > Is it a limitation of CQL3 and its connection vs. thrift?
> > Or more likely i'm just doing something wrong?
> >
> > Thanks,
> > Joe
>
>
>
> --
> Jonathan Ellis
> Project Chair, Apache Cassandra
> co-founder, http://www.datastax.com
> @spyced
>

Re: Dynamic Columns Question Cassandra 1.2.5, Datastax Java Driver 1.0

Posted by Jonathan Ellis <jb...@gmail.com>.
This is becoming something of a FAQ, so I wrote an more in-depth
answer: http://www.datastax.com/dev/blog/does-cql-support-dynamic-columns-wide-rows

On Thu, Jun 6, 2013 at 8:02 AM, Joe Greenawalt <jo...@gmail.com> wrote:
> Hi,
> I'm having some problems figuring out how to append a dynamic column on a
> column family using the datastax java driver 1.0 and CQL3 on Cassandra
> 1.2.5.  Below is what i'm trying:
>
> cqlsh:simplex> create table user (firstname text primary key, lastname
> text);
> cqlsh:simplex> insert into user (firstname, lastname) values
> ('joe','shmoe');
> cqlsh:simplex> select * from user;
>
>  firstname | lastname
> -----------+----------
>        joe |    shmoe
>
> cqlsh:simplex> insert into user (firstname, lastname, middlename) values
> ('joe','shmoe','lester');
> Bad Request: Unknown identifier middlename
> cqlsh:simplex> insert into user (firstname, lastname, middlename) values
> ('john','shmoe','lester');
> Bad Request: Unknown identifier middlename
>
> I'm assuming you can do this based on previous based thrift based clients
> like pycassa, and also by reading this:
>
> The Cassandra data model is a dynamic schema, column-oriented data model.
> This means that, unlike a relational database, you do not need to model all
> of the columns required by your application up front, as each row is not
> required to have the same set of columns. Columns and their metadata can be
> added by your application as they are needed without incurring downtime to
> your application.
>
> here: http://www.datastax.com/docs/1.2/ddl/index
>
> Is it a limitation of CQL3 and its connection vs. thrift?
> Or more likely i'm just doing something wrong?
>
> Thanks,
> Joe



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder, http://www.datastax.com
@spyced