CQL, ‘THEN AND NOW’

   Cassandra London
                Feb, 20th 2012


           Courtney Robinson
           courtney@crlog.info
              @zcourts
           http://crlog.info
   github.com/zcourts
IN THE BEGINNING
   ...horrible thrift code here
AND THEN THERE WAS...
   ...better looking hector code here
NOT QUITE
   ...slightly better (my hector wrapper)




 Still not excellent, but better (I think)
 Remember, not all languages have clients as good as
  hector.
 Usability varied* vastly between the supported languages
 So much so I chose Play! Framework over PHP for a
  small admin front end.
YAY! CQL TO SAVE THE DAY!




 ...because not everyone has an Ops team to torture.
 Upgrading wasn’t such a pain, little or no code breaking

 CQL offered stability (ish)...
BRIEF INTRO – WHAT IS IT?
   Simple, structured query language for Cassandra

   Very much SQL (except where it can’t be)

   Alternative to the Thrift RPC API.

   Available since Cassandra version 0.8.0

   In keeping with Eric Evan’s attempts, just pronounce it
    ‘siːkwəl’

   Isn’t much* to say about CQL, its does what it says on the
    tin
CONTROVERSY, POLITICS AND OUT RIGHT BI***ING
   Always been an outspoken    (some more than others)
                                                          few against it

   Never been much in the way of facts to backup their claims
    such as:

   SQL like syntax is a very idiomatic RDMS thing.

   Parsing a string will be slow, just because its parsing a string
    and for no other reason

   The aforementioned will make Cassandra ‘as vulnerable’ to
    injection

   ...etc (all speculation mind you)
SO WHAT, CAN I USE THIS THING?
   CQL is very much production ready.

   If anyone tells you otherwise, ask them to prove its not before you
    decide.

   My tiny 5 Node cluster is nothing to boast about, but it handles a good
    150+ GB of data a day

   Every* query is done with CQL

   Except on a single CF which uses super columns.

   CQL does not and most likely will not ever support super columns.

   Compound column (CASSANDRA-2474 monster ticket) resolved (ish).
CQL V1.0.0 - DEBUT KEYWORDS
 USE
 SELECT
                         That’s right!
 UPDATE

 DELETE
                        No INSERT...?
 TRUNCATE

 DROP

 BATCH
          SPECIAL STATEMENTS
 CREATE KEYSPACE
 CREATE COLUMNFAMILY

 CREATE INDEX                            10
                                         total
TIME TELLS NO LIES, CQL V2
   ALTER COLUMNFAMILY
   BATCH                      Create table is nothing more
                                  than an alias to create
   CREATE INDEX
                                      columnfamily
   CREATE KEYSPACE
   CREATE COLUMNFAMILY
   CREATE TABLE (CASSANDRA-2743)
   DELETE
                                            Rational: ‘create an
   DROP COLUMNFAMILY                       alias to be friendlier
   DROP INDEX                                to existing tools’
   DROP KEYSPACE
   INSERT
   SELECT
   TRUNCATE                                                 15
                                                            total
   UPDATE
   USE
CQL V3, AKA CASSANDRA-3761

   About 13 sub-tickets

   Most unresolved

   It’d be unwise to list features

   Any of these could be dropped/altered before V3 is
    finalized (C* V1.1.1 is the roadmap release for V3)

   Backwards incompatibility (hence major version jump)

   Not the little project it used to be, would take all night to
    cover each feature with enough details
TERMINOLOGY WAR...
   CQL’s changing fast (maybe too fast?)

   Terminology looks to be changing

   Creating over lap in some places

   May become, or already is confusing

   Not sure those in charge are seeing it

   At a stage where its probably as confusing as other, more
    complicated C* features

   Progress is great, but so is usability & simplicity...
COURTNEY ROBINSON @ZCOURTS


           Thank you for listening.


            Questions?
                                Links:
    https://github.com/apache/cassandra/blob/trunk/doc/cql/CQL.textile
 http://crlog.info/2011/09/17/cassandra-query-language-cql-v2-0-reference/
         https://issues.apache.org/jira/browse/CASSANDRA-2743

CQL, then and now

  • 1.
    CQL, ‘THEN ANDNOW’ Cassandra London Feb, 20th 2012 Courtney Robinson courtney@crlog.info @zcourts http://crlog.info github.com/zcourts
  • 2.
    IN THE BEGINNING  ...horrible thrift code here
  • 3.
    AND THEN THEREWAS...  ...better looking hector code here
  • 4.
    NOT QUITE  ...slightly better (my hector wrapper)  Still not excellent, but better (I think)  Remember, not all languages have clients as good as hector.  Usability varied* vastly between the supported languages  So much so I chose Play! Framework over PHP for a small admin front end.
  • 5.
    YAY! CQL TOSAVE THE DAY!  ...because not everyone has an Ops team to torture.  Upgrading wasn’t such a pain, little or no code breaking  CQL offered stability (ish)...
  • 6.
    BRIEF INTRO –WHAT IS IT?  Simple, structured query language for Cassandra  Very much SQL (except where it can’t be)  Alternative to the Thrift RPC API.  Available since Cassandra version 0.8.0  In keeping with Eric Evan’s attempts, just pronounce it ‘siːkwəl’  Isn’t much* to say about CQL, its does what it says on the tin
  • 7.
    CONTROVERSY, POLITICS ANDOUT RIGHT BI***ING  Always been an outspoken (some more than others) few against it  Never been much in the way of facts to backup their claims such as:  SQL like syntax is a very idiomatic RDMS thing.  Parsing a string will be slow, just because its parsing a string and for no other reason  The aforementioned will make Cassandra ‘as vulnerable’ to injection  ...etc (all speculation mind you)
  • 8.
    SO WHAT, CANI USE THIS THING?  CQL is very much production ready.  If anyone tells you otherwise, ask them to prove its not before you decide.  My tiny 5 Node cluster is nothing to boast about, but it handles a good 150+ GB of data a day  Every* query is done with CQL  Except on a single CF which uses super columns.  CQL does not and most likely will not ever support super columns.  Compound column (CASSANDRA-2474 monster ticket) resolved (ish).
  • 9.
    CQL V1.0.0 -DEBUT KEYWORDS  USE  SELECT That’s right!  UPDATE  DELETE No INSERT...?  TRUNCATE  DROP  BATCH SPECIAL STATEMENTS  CREATE KEYSPACE  CREATE COLUMNFAMILY  CREATE INDEX 10 total
  • 10.
    TIME TELLS NOLIES, CQL V2  ALTER COLUMNFAMILY  BATCH Create table is nothing more than an alias to create  CREATE INDEX columnfamily  CREATE KEYSPACE  CREATE COLUMNFAMILY  CREATE TABLE (CASSANDRA-2743)  DELETE Rational: ‘create an  DROP COLUMNFAMILY alias to be friendlier  DROP INDEX to existing tools’  DROP KEYSPACE  INSERT  SELECT  TRUNCATE 15 total  UPDATE  USE
  • 11.
    CQL V3, AKACASSANDRA-3761  About 13 sub-tickets  Most unresolved  It’d be unwise to list features  Any of these could be dropped/altered before V3 is finalized (C* V1.1.1 is the roadmap release for V3)  Backwards incompatibility (hence major version jump)  Not the little project it used to be, would take all night to cover each feature with enough details
  • 12.
    TERMINOLOGY WAR...  CQL’s changing fast (maybe too fast?)  Terminology looks to be changing  Creating over lap in some places  May become, or already is confusing  Not sure those in charge are seeing it  At a stage where its probably as confusing as other, more complicated C* features  Progress is great, but so is usability & simplicity...
  • 14.
    COURTNEY ROBINSON @ZCOURTS Thank you for listening. Questions? Links: https://github.com/apache/cassandra/blob/trunk/doc/cql/CQL.textile http://crlog.info/2011/09/17/cassandra-query-language-cql-v2-0-reference/ https://issues.apache.org/jira/browse/CASSANDRA-2743