nosql yes, but yescql, no?
DESCRIPTION
TRANSCRIPT
![Page 1: NoSQL Yes, But YesCQL, No?](https://reader033.vdocuments.us/reader033/viewer/2022042714/54b7b0eb4a795939708b4593/html5/thumbnails/1.jpg)
NoSQL Yes, But YesCQL, No?
Berlin BuzzwordsJune 7, 2011
Eric [email protected]
@jericevanshttp://blog.sym-link.com
![Page 2: NoSQL Yes, But YesCQL, No?](https://reader033.vdocuments.us/reader033/viewer/2022042714/54b7b0eb4a795939708b4593/html5/thumbnails/2.jpg)
Cassandra Query Language
● Structured query language for Apache Cassandra.
● CQL for short (pronounced /si kw l/).ː ə● SQL alike (best effort).● An alternative to the existing API, not a
replacement (not yet).● Available for use in Cassandra 0.8.0.
![Page 3: NoSQL Yes, But YesCQL, No?](https://reader033.vdocuments.us/reader033/viewer/2022042714/54b7b0eb4a795939708b4593/html5/thumbnails/3.jpg)
Wait, aren't you the guy...?
![Page 4: NoSQL Yes, But YesCQL, No?](https://reader033.vdocuments.us/reader033/viewer/2022042714/54b7b0eb4a795939708b4593/html5/thumbnails/4.jpg)
![Page 5: NoSQL Yes, But YesCQL, No?](https://reader033.vdocuments.us/reader033/viewer/2022042714/54b7b0eb4a795939708b4593/html5/thumbnails/5.jpg)
So, is this a troll?
![Page 6: NoSQL Yes, But YesCQL, No?](https://reader033.vdocuments.us/reader033/viewer/2022042714/54b7b0eb4a795939708b4593/html5/thumbnails/6.jpg)
Gonna Give You Up.
Never.
![Page 7: NoSQL Yes, But YesCQL, No?](https://reader033.vdocuments.us/reader033/viewer/2022042714/54b7b0eb4a795939708b4593/html5/thumbnails/7.jpg)
Naw.(not a troll, honest)
![Page 8: NoSQL Yes, But YesCQL, No?](https://reader033.vdocuments.us/reader033/viewer/2022042714/54b7b0eb4a795939708b4593/html5/thumbnails/8.jpg)
But, why?
![Page 9: NoSQL Yes, But YesCQL, No?](https://reader033.vdocuments.us/reader033/viewer/2022042714/54b7b0eb4a795939708b4593/html5/thumbnails/9.jpg)
Because the API sucks.
![Page 10: NoSQL Yes, But YesCQL, No?](https://reader033.vdocuments.us/reader033/viewer/2022042714/54b7b0eb4a795939708b4593/html5/thumbnails/10.jpg)
“Thrift sucks, ergo the API sucks”
● Generated code (C++ compiler).● Loads of languages, but varying levels of
support.● PHP anyone?
● Upstream alternating between extremes of combativeness and apathy.● Patches ignored, (or refused).● Loads of (serious )bugs ignored for long periods.● Infrequent releases.
![Page 11: NoSQL Yes, But YesCQL, No?](https://reader033.vdocuments.us/reader033/viewer/2022042714/54b7b0eb4a795939708b4593/html5/thumbnails/11.jpg)
“Avro Does Not Suck, so...”
1. Avro
2. Something, something, something
3. Profit!
![Page 12: NoSQL Yes, But YesCQL, No?](https://reader033.vdocuments.us/reader033/viewer/2022042714/54b7b0eb4a795939708b4593/html5/thumbnails/12.jpg)
And the API still sucks.
![Page 13: NoSQL Yes, But YesCQL, No?](https://reader033.vdocuments.us/reader033/viewer/2022042714/54b7b0eb4a795939708b4593/html5/thumbnails/13.jpg)
Brass Tacks
● Unstable● Too tightly coupled to internal APIs
● Too difficult to use● Very little abstraction (forces clients to abstract)● Poor mental fit for query/data models
![Page 14: NoSQL Yes, But YesCQL, No?](https://reader033.vdocuments.us/reader033/viewer/2022042714/54b7b0eb4a795939708b4593/html5/thumbnails/14.jpg)
Back to the drawing board
● RPC (Thrift, Avro, Protobuf, etc)● REST● Query language● Etc, etc
![Page 15: NoSQL Yes, But YesCQL, No?](https://reader033.vdocuments.us/reader033/viewer/2022042714/54b7b0eb4a795939708b4593/html5/thumbnails/15.jpg)
Back to the drawing board
● RPC (Thrift, Avro, Protobuf, etc)● Easy to implement● Performant
● REST● Query language● Etc, etc
![Page 16: NoSQL Yes, But YesCQL, No?](https://reader033.vdocuments.us/reader033/viewer/2022042714/54b7b0eb4a795939708b4593/html5/thumbnails/16.jpg)
Back to the drawing board
● RPC (Thrift, Avro, Protobuf, etc)● Easy to implement● Performant
● REST● Little need for client abstraction
● Query language● Etc, etc
![Page 17: NoSQL Yes, But YesCQL, No?](https://reader033.vdocuments.us/reader033/viewer/2022042714/54b7b0eb4a795939708b4593/html5/thumbnails/17.jpg)
Back to the drawing board
● RPC (Thrift, Avro, Protobuf, etc)● Easy to implement● Performant
● REST● Little need for client abstraction
● Query language● Little need for client abstraction● Reads well; What you see is what you get● The Devil we all know
● Etc, etc
![Page 18: NoSQL Yes, But YesCQL, No?](https://reader033.vdocuments.us/reader033/viewer/2022042714/54b7b0eb4a795939708b4593/html5/thumbnails/18.jpg)
Grok This
firstname = Column(name="firstname", value="Eric", timestamp=time)
firstcosc = ColumnOrSuperColumn(column=firstname)
lastname = Column(name="lastname", value="Evans", timestamp=time)
lastcosc = ColumnOrSuperColumn(column=lastname)
mutations = []
mutations.append(Mutation(column_or_supercolumn=firstcosc))
mutations.append(Mutation(column_or_supercolumn=lastcosc))
client.batch_mutate(mutation_map={"eevans": {"table": mutations}}, consistency_level=ConsistencyLevel.ONE)
![Page 19: NoSQL Yes, But YesCQL, No?](https://reader033.vdocuments.us/reader033/viewer/2022042714/54b7b0eb4a795939708b4593/html5/thumbnails/19.jpg)
What about this?
UPDATE tableSET firstname=Eric, lastname=Evans WHERE KEY=eevans
![Page 20: NoSQL Yes, But YesCQL, No?](https://reader033.vdocuments.us/reader033/viewer/2022042714/54b7b0eb4a795939708b4593/html5/thumbnails/20.jpg)
Grok This
parent = ColumnParent(column_family="table")colnames = ["firstname", "lastname"]predicate = SlicePredicate(column_names=colnames)row = client.get_slice(key="eevans", column_parent=parent, predicate=predicate, consistency_level=CL.ONE)
![Page 21: NoSQL Yes, But YesCQL, No?](https://reader033.vdocuments.us/reader033/viewer/2022042714/54b7b0eb4a795939708b4593/html5/thumbnails/21.jpg)
And this?
SELECT firstname, lastnameFROM table WHERE KEY = eevans
![Page 22: NoSQL Yes, But YesCQL, No?](https://reader033.vdocuments.us/reader033/viewer/2022042714/54b7b0eb4a795939708b4593/html5/thumbnails/22.jpg)
Official(?) Drivers
● Java (JDBC)● Python (DBAPI2)● Node.js● Twisted● PHP (coming soon?)● Ruby (coming soon?)
![Page 23: NoSQL Yes, But YesCQL, No?](https://reader033.vdocuments.us/reader033/viewer/2022042714/54b7b0eb4a795939708b4593/html5/thumbnails/23.jpg)
More Info
● Docs (doc/cql/CQL.html)● http://www.datastax.com/docs/0.8/api/using_cql● http://caqel.deadcafe.org (live demo!)● cqlsh (interactive shell shipped w/ Python
driver)
![Page 24: NoSQL Yes, But YesCQL, No?](https://reader033.vdocuments.us/reader033/viewer/2022042714/54b7b0eb4a795939708b4593/html5/thumbnails/24.jpg)