Re: Generic questions over Cassandra 1.1/1.2

2012-11-28 Thread Bill de hÓra

 Compact storage is the schemaless of old.

Right. That comes with the downside of picking one :)  It does not seem 
the compact storage is the default choice for the the future. As well as 
interop with the thrift/cli world, I also find it hard to reason about 
row caching with CQL defined tables. I still work through thrift/cli as 
a result, which is a pity because CQL has a nice surface.


Bill

On 28/11/12 01:32, Edward Capriolo wrote:

@Bill

Are you saying that now cassandra is less schema less ? :)

Compact storage is the schemaless of old.

On Tuesday, November 27, 2012, Bill de hÓra b...@dehora.net
mailto:b...@dehora.net wrote:
  I'm not sure I always
  understand what people mean by schema less
  exactly and I'm curious.
 
  For 'schema less', given this -
 
  {{{
  cqlsh use example;
  cqlsh:example CREATE TABLE users (
  ...  user_name varchar,
  ...  password varchar,
  ...  gender varchar,
  ...  session_token varchar,
  ...  state varchar,
  ...  birth_year bigint,
  ...  PRIMARY KEY (user_name)
  ... );
  }}}
 
  I expect this would not cause an unknown identifier error -
 
  {{{
  INSERT INTO users
  (user_name, password, extra, moar)
  VALUES
  ('bob', 'secret', 'a', 'b');
  }}}
 
  but definitions vary.
 
  Bill
 
  On 26/11/12 09:18, Sylvain Lebresne wrote:
 
  On Mon, Nov 26, 2012 at 8:41 AM, aaron morton
aa...@thelastpickle.com mailto:aa...@thelastpickle.com
  mailto:aa...@thelastpickle.com mailto:aa...@thelastpickle.com
wrote:
 Is there any noticeable performance difference between thrift
or CQL3?
Off the top of my head it's within 5% (maybe 10%) under stress tests.
  See Eric's talk at the Cassandra SF conference for the exact numbers.
 
  Eric's benchmark results was that normal queries were slightly slower
  but prepared one (and in real life, I see no good reason not to prepare
  statements) were actually slightly faster.
 
CQL 3 requires a schema, however altering the schema is easier. And
  in 1.2 will support concurrent schema modifications.
Thrift API is still schema less.
 
  Sorry to hijack this thread, but I'd be curious (like seriously, I'm not
  trolling) to understand what you mean by CQL 3 requires a schema but
  Thrift API is still schema less. Basically I'm not sure I always
  understand what people mean by schema less exactly and I'm curious.
 
  --
  Sylvain
 
 




Re: Generic questions over Cassandra 1.1/1.2

2012-11-27 Thread Bill de hÓra

 I'm not sure I always
 understand what people mean by schema less
 exactly and I'm curious.

For 'schema less', given this -

{{{
cqlsh use example;
cqlsh:example CREATE TABLE users (
...  user_name varchar,
...  password varchar,
...  gender varchar,
...  session_token varchar,
...  state varchar,
...  birth_year bigint,
...  PRIMARY KEY (user_name)
... );
}}}

I expect this would not cause an unknown identifier error -

{{{
INSERT INTO users
(user_name, password, extra, moar)
VALUES
('bob', 'secret', 'a', 'b');
}}}

but definitions vary.

Bill

On 26/11/12 09:18, Sylvain Lebresne wrote:

On Mon, Nov 26, 2012 at 8:41 AM, aaron morton aa...@thelastpickle.com
mailto:aa...@thelastpickle.com wrote:
   Is there any noticeable performance difference between thrift or CQL3?
  Off the top of my head it's within 5% (maybe 10%) under stress tests.
See Eric's talk at the Cassandra SF conference for the exact numbers.

Eric's benchmark results was that normal queries were slightly slower
but prepared one (and in real life, I see no good reason not to prepare
statements) were actually slightly faster.

  CQL 3 requires a schema, however altering the schema is easier. And
in 1.2 will support concurrent schema modifications.
  Thrift API is still schema less.

Sorry to hijack this thread, but I'd be curious (like seriously, I'm not
trolling) to understand what you mean by CQL 3 requires a schema but
Thrift API is still schema less. Basically I'm not sure I always
understand what people mean by schema less exactly and I'm curious.

--
Sylvain




Re: Generic questions over Cassandra 1.1/1.2

2012-11-27 Thread Edward Capriolo
@Bill

Are you saying that now cassandra is less schema less ? :)

Compact storage is the schemaless of old.

On Tuesday, November 27, 2012, Bill de hÓra b...@dehora.net wrote:
 I'm not sure I always
 understand what people mean by schema less
 exactly and I'm curious.

 For 'schema less', given this -

 {{{
 cqlsh use example;
 cqlsh:example CREATE TABLE users (
 ...  user_name varchar,
 ...  password varchar,
 ...  gender varchar,
 ...  session_token varchar,
 ...  state varchar,
 ...  birth_year bigint,
 ...  PRIMARY KEY (user_name)
 ... );
 }}}

 I expect this would not cause an unknown identifier error -

 {{{
 INSERT INTO users
 (user_name, password, extra, moar)
 VALUES
 ('bob', 'secret', 'a', 'b');
 }}}

 but definitions vary.

 Bill

 On 26/11/12 09:18, Sylvain Lebresne wrote:

 On Mon, Nov 26, 2012 at 8:41 AM, aaron morton aa...@thelastpickle.com
 mailto:aa...@thelastpickle.com wrote:
Is there any noticeable performance difference between thrift or
CQL3?
   Off the top of my head it's within 5% (maybe 10%) under stress tests.
 See Eric's talk at the Cassandra SF conference for the exact numbers.

 Eric's benchmark results was that normal queries were slightly slower
 but prepared one (and in real life, I see no good reason not to prepare
 statements) were actually slightly faster.

   CQL 3 requires a schema, however altering the schema is easier. And
 in 1.2 will support concurrent schema modifications.
   Thrift API is still schema less.

 Sorry to hijack this thread, but I'd be curious (like seriously, I'm not
 trolling) to understand what you mean by CQL 3 requires a schema but
 Thrift API is still schema less. Basically I'm not sure I always
 understand what people mean by schema less exactly and I'm curious.

 --
 Sylvain




Re: Generic questions over Cassandra 1.1/1.2

2012-11-26 Thread Sylvain Lebresne
On Mon, Nov 26, 2012 at 8:41 AM, aaron morton aa...@thelastpickle.comwrote:
  Is there any noticeable performance difference between thrift or CQL3?
 Off the top of my head it's within 5% (maybe 10%) under stress tests. See
Eric's talk at the Cassandra SF conference for the exact numbers.

Eric's benchmark results was that normal queries were slightly slower but
prepared one (and in real life, I see no good reason not to prepare
statements) were actually slightly faster.

 CQL 3 requires a schema, however altering the schema is easier. And in
1.2 will support concurrent schema modifications.
 Thrift API is still schema less.

Sorry to hijack this thread, but I'd be curious (like seriously, I'm not
trolling) to understand what you mean by CQL 3 requires a schema but
Thrift API is still schema less. Basically I'm not sure I always
understand what people mean by schema less exactly and I'm curious.

--
Sylvain


Re: Generic questions over Cassandra 1.1/1.2

2012-11-26 Thread cbert...@libero.it
 Aaron first of all thanks for your precious help everytime ….
Thanks for using Cassandra since version 0.6 :)

ahahah :-) 

There are two types of CQL 3 tables, regular ones and those that use COMPACT 
STORAGE. Regular CQL 3 tables are not visible to Thrift as they store some 
extra data that thrift clients may not understand. COMPACT STORAGE tables are 
visible to thrift for read and write, not sure about schema mods. They do not 
support the compound primary key,

Thanks for the answer ... the error described before is: ORDER BY is only 
supported when the partition key is restricted by an EQ or an IN.
But I don't see how I didn't respect the rule ...

Cheers,
Carlo


Re: Generic questions over Cassandra 1.1/1.2

2012-11-26 Thread Sylvain Lebresne

 Thanks for the answer ... the error described before is: ORDER BY is only
 supported when the partition key is restricted by an EQ or an IN.
 But I don't see how I didn't respect the rule ...


The error message is indeed somewhat misleading and I've just committed a
fix to return a better message. But at the end of the day, the limitation
is that ORDER BY is just not supported with 2ndary indexes.

--
Sylvain


R: Re: Generic questions over Cassandra 1.1/1.2

2012-11-26 Thread cbert...@libero.it

Da: sylv...@datastax.com

 The error message is indeed somewhat misleading and I've just committed a fix 
 to return a better message. But at the end of the day, the  limitation is 
 that ORDER BY is just not supported with 2ndary indexes.
mmm this is not good news for the model I just designed ... however thanks for 
the information.
Please write it somewhere in datastax documentation cause I didn't find it 
anywhere and lost time to understand what I did wrong :-)
 --Sylvain




 

Re: Generic questions over Cassandra 1.1/1.2

2012-11-25 Thread aaron morton
 Now I am going to write a new application using cassandra so I started 
 reading 
 documentation in order to model the new db using all the new features and 
 not 
 reinventing the wheel.
Some resources for CQL 3, it may match your needs. If not you can still use 
Thrift through your favourite client...

There have been a few articles on the DS blog http://www.datastax.com/dev/blog
A talk at the conference by Eric  
http://www.datastax.com/events/cassandrasummit2012/presentations
I did a webinar about it last month 
http://www.datastax.com/resources/webinars/collegecredit

 1) SCF are deprecated and I see that what it used to be a development concept 
 (use a CF and build a row name using ROW+SC name, if you want keep sorting 
 use 
 OPP) has become a Cassandra Concept (compund key).
Yup (they have not been officially deprecated, it's just recommended that you 
do not use them). 

 
 SELECT * FROM ctable WHERE basekey = ?  and myvalue = ? ORDER BY extensionkey 
 DESC LIMIT 5
 I haven't been able to do it ….
That looks ok, what was the error ? 
What cassandra version and what CQL version?
 
 2) Is Cassandra still schemaless? One thing I loved is that to create a new 
 column I didn't have to alter any cf before. 
 Trying CQL 3 I noticed that if I try to make an insert of a new column not 
 defined in schema I raised an exception. 
CQL 3 requires a schema, however altering the schema is easier. And in 1.2 will 
support concurrent schema modifications. 
Thrift API is still schema less. 

Cheers

-
Aaron Morton
Freelance Cassandra Developer
New Zealand

@aaronmorton
http://www.thelastpickle.com

On 26/11/2012, at 12:21 AM, cbert...@libero.it wrote:

 Hi all,
 I'm in production with cassandra since version 0.6 then upgraded to 0.7 and 
 finally to 1.0.
 If I look at my schema now it's senseless to be on 1.0 but many things 
 changed from 0.6 ... secondary indexes, counters, expiring columns and more.
 Now I am going to write a new application using cassandra so I started 
 reading 
 documentation in order to model the new db using all the new features and 
 not 
 reinventing the wheel.
 
 So let's start with couple of questions ... sorry if stupid :-)
 
 1) SCF are deprecated and I see that what it used to be a development concept 
 (use a CF and build a row name using ROW+SC name, if you want keep sorting 
 use 
 OPP) has become a Cassandra Concept (compund key).
 Is it right? And more, can I avoid OPP when using compound keys since inside 
 partition key data are ordered on the remaining components of the primary key?
 
 finally  I've tried to use the order by to sort data and it works -- but can 
 I 
 use order by and where clause on a secondary index together? 
 
 CREATE TABLE ctable (
basekey uuid,
extensionkey uuid,
myvalue varchar,
PRIMARY KEY (basekey, extensionkey)
 )
 
 SELECT * FROM ctable WHERE basekey = ?  and myvalue = ? ORDER BY extensionkey 
 DESC LIMIT 5
 I haven't been able to do it 
 
 2) Is Cassandra still schemaless? One thing I loved is that to create a new 
 column I didn't have to alter any cf before. 
 Trying CQL 3 I noticed that if I try to make an insert of a new column not 
 defined in schema I raised an exception. 
 
 Thanks in advance for any help
 
 Carlo
 
 
 
 



R: Re: Generic questions over Cassandra 1.1/1.2

2012-11-25 Thread cbert...@libero.it

Aaron first of all thanks for your precious help everytime 

Some resources for CQL 3, it may match your needs. If not you can still use 
Thrift through your favourite client...There have been a few articles on the DS 
blog http://www.datastax.com/dev/blogA talk at the conference by Eric  
http://www.datastax.com/events/cassandrasummit2012/presentationsI did a webinar 
about it last month http://www.datastax.com/resources/webinars/collegecredit
I will read all the links carefully. The idea was to keep Pelops (client I am 
familiar with) and include CQL3 through the new Java driver Datastax is going 
to provide.
SELECT * FROM ctable WHERE basekey = ?  and myvalue = ? ORDER BY extensionkey 
DESC LIMIT 5
I haven't been able to do it ….
That looks ok, what was the error ? What cassandra version and what CQL version?
Cassandra 1.2 beta2 and CQL 3 -- honestly I didn't remember the exact  error 
(only that it was about the order by) and I don't have Cassandra here to try. 
Will write more about this tomorrow ... however if I avoided the where on 
secondary indexed column the query was ok. 
2) Is Cassandra still schemaless? One thing I loved is that to create a new 
column I didn't have to alter any cf before. 
Trying CQL 3 I noticed that if I try to make an insert of a new column not 
defined in schema I raised an exception. 
CQL 3 requires a schema, however altering the schema is easier. And in 1.2 will 
support concurrent schema modifications. Thrift API is still schema less. 
What it means that it will support concurrent schema modifications? (if the 
answer is in the link above I will know tomorrow :) )I imagined that only CQL 
required a schema. What happen in a situation like this?
1) I create a table using CQL2) I add a new column using Thrift3) I query for 
the column using CQL
One more question:Is there any noticeable performance difference between thrift 
or CQL3?
Thanks,Carlo

Re: Generic questions over Cassandra 1.1/1.2

2012-11-25 Thread aaron morton
 Aaron first of all thanks for your precious help everytime ….
Thanks for using Cassandra since version 0.6 :)

 What it means that it will support concurrent schema modifications?
Previously we said you can change the schema online, but only do it at one node 
at a time. In v1.2 you can have multiple clients issues schema changes without 
worrying about serialising them. 


 I imagined that only CQL required a schema. What happen in a situation like 
 this?
 
 1) I create a table using CQL
 2) I add a new column using Thrift
 3) I query for the column using CQL
For background see the CQL for Cassandra Experts and CQL to Thrift 
migration DS blog posts. 

There are two types of CQL 3 tables, regular ones and those that use COMPACT 
STORAGE. Regular CQL 3 tables are not visible to Thrift as they store some 
extra data that thrift clients may not understand. COMPACT STORAGE tables are 
visible to thrift for read and write, not sure about schema mods. They do not 
support the compound primary key,

 Is there any noticeable performance difference between thrift or CQL3?
Off the top of my head it's within 5% (maybe 10%) under stress tests. See 
Eric's talk at the Cassandra SF conference for the exact numbers.

Cheers

-
Aaron Morton
Freelance Cassandra Developer
New Zealand

@aaronmorton
http://www.thelastpickle.com

On 26/11/2012, at 11:58 AM, cbert...@libero.it wrote:

 Aaron first of all thanks for your precious help everytime 
 
 
 Some resources for CQL 3, it may match your needs. If not you can still use 
 Thrift through your favourite client...
 There have been a few articles on the DS blog http://www.datastax.com/dev/blog
 A talk at the conference by Eric  
 http://www.datastax.com/events/cassandrasummit2012/presentations
 I did a webinar about it last month 
 http://www.datastax.com/resources/webinars/collegecredit
 
 I will read all the links carefully. The idea was to keep Pelops (client I am 
 familiar with) and include CQL3 through the new Java driver Datastax is going 
 to provide.
 
 SELECT * FROM ctable WHERE basekey = ?  and myvalue = ? ORDER BY 
 extensionkey 
 DESC LIMIT 5
 I haven't been able to do it ….
 
 That looks ok, what was the error ? 
 What cassandra version and what CQL version?
 
 Cassandra 1.2 beta2 and CQL 3 -- honestly I didn't remember the exact  error 
 (only that it was about the order by) and I don't have Cassandra here to try. 
 Will write more about this tomorrow ... however if I avoided the where on 
 secondary indexed column the query was ok. 
 
 2) Is Cassandra still schemaless? One thing I loved is that to create a new 
 column I didn't have to alter any cf before. 
 Trying CQL 3 I noticed that if I try to make an insert of a new column not 
 defined in schema I raised an exception. 
 
 CQL 3 requires a schema, however altering the schema is easier. And in 1.2 
 will support concurrent schema modifications. 
 Thrift API is still schema less. 
 
 What it means that it will support concurrent schema modifications? (if the 
 answer is in the link above I will know tomorrow :) )
 I imagined that only CQL required a schema. What happen in a situation like 
 this?
 
 1) I create a table using CQL
 2) I add a new column using Thrift
 3) I query for the column using CQL
 
 One more question:
 Is there any noticeable performance difference between thrift or CQL3?
 
 Thanks,
 Carlo