SlideShare a Scribd company logo
1 of 96
Download to read offline
Apache Cassandra

                                  Clients and
                                  Transports


Thursday, February 28, 13
Hi Folks!
                I’m Nate
                @zznate



Thursday, February 28, 13
API Management
                API Analytics
                API Tools

Thursday, February 28, 13
Clients and transports
                for Cassandra




Thursday, February 28, 13
But first...
                some questions




Thursday, February 28, 13
But first:
                Architectural stuff




Thursday, February 28, 13
Cassandra:
                “Sparsely Columnar”




Thursday, February 28, 13
An RDBMS table




Thursday, February 28, 13
An RDBMS table




Thursday, February 28, 13
Cassandra Style




Thursday, February 28, 13
Cassandra Style




Thursday, February 28, 13
Cassandra data
                modelling




Thursday, February 28, 13
Four common patterns
                Simple object to simple row
                Sparse object to rows
                Materialized view
                Manual index


Thursday, February 28, 13
simple objects to
                simple row




Thursday, February 28, 13
“static” column family




Thursday, February 28, 13
Sparse Objects




Thursday, February 28, 13
“dynamic” column family




Thursday, February 28, 13
Materialized Views




Thursday, February 28, 13
Materialized view




Thursday, February 28, 13
Regardless of the
                approached used, there
                are four overall goals



Thursday, February 28, 13
1. Denormalize
                2. Eliminate seeks
                3. Design for read
                4. Optimiza for blind
                writes

Thursday, February 28, 13
Now... let’s talk about
                protocols




Thursday, February 28, 13
Thrift




Thursday, February 28, 13
Thrift
                RPC-Based




Thursday, February 28, 13
Thrift
                RPC-Based
                Mature Apache Project




Thursday, February 28, 13
Thrift
                RPC-Based
                Mature Apache Project
                Supports lots of languages



Thursday, February 28, 13
Thrift
                RPC-Based
                Mature Apache Project
                Supports lots of languages
                Extensible!


Thursday, February 28, 13
CQL




Thursday, February 28, 13
CQL
                Well defined protocol




Thursday, February 28, 13
CQL
                Well defined protocol
                Supports Compression




Thursday, February 28, 13
CQL
                Well defined protocol
                Supports Compression
                Netty/NIO-based



Thursday, February 28, 13
Storage Mechanics
                (but quickly)




Thursday, February 28, 13
get_slice


            Workhorse of Cassandra selection
            methods



Thursday, February 28, 13
get_slice: key



            The row key




Thursday, February 28, 13
get_slice: ColumnParent



            The column family (a.k.a table)




Thursday, February 28, 13
get_slice: SlicePredicate


            defines the column range, or
            specifically named columns



Thursday, February 28, 13
get_slice:ConsistencyLevel


            The level of consistency we want for
            this read



Thursday, February 28, 13
Obtuse at first glance,
                but nothing is hidden




Thursday, February 28, 13
So...




Thursday, February 28, 13
But one person’s
                abstraction leakage is
                another’s preffered
                model


Thursday, February 28, 13
How closely do you
                want to interact with
                the underlying storage
                engine?


Thursday, February 28, 13
Client APIs




Thursday, February 28, 13
Benefits of thrift




Thursday, February 28, 13
Benefits of thrift
                Mature selection of clients




Thursday, February 28, 13
Benefits of thrift
                Mature selection of clients
                Multiple languages




Thursday, February 28, 13
Benefits of thrift
                Mature selection of clients
                Multiple languages
                Well documented




Thursday, February 28, 13
Benefits of thrift
                Mature selection of clients
                Multiple languages
                Well documented
                Can be used in other places


Thursday, February 28, 13
Drawbacks of thrift




Thursday, February 28, 13
Drawbacks of thrift
                Several objects are required for
                any request




Thursday, February 28, 13
Drawbacks of thrift
                Several objects are required for
                any request
                Clients differs in implementation




Thursday, February 28, 13
Drawbacks of thrift
                Several objects are required for
                any request
                Clients differs in implementation
                Upstream dependency issues


Thursday, February 28, 13
Drawbacks of thrift
                Several objects are required for
                any request
                Clients differs in implementation
                Upstream dependency issues
                Schema changes and cluster
                health done pro-actively
Thursday, February 28, 13
Benefits of cql api




Thursday, February 28, 13
Benefits of cql api
                Stored procedures




Thursday, February 28, 13
Benefits of cql api
               Stored procedures
               Common operations are
               straight forward




Thursday, February 28, 13
Benefits of cql api
               Stored procedures
               Common operations are
               straight forward
               Cluster health and schema
               change push-back

Thursday, February 28, 13
Benefits of cql api
               Stored procedures
               Common operations are
               straight forward
               Cluster health and schema
               change push-back
               Awesome client available
Thursday, February 28, 13
Drawbacks of CQL apis




Thursday, February 28, 13
Drawbacks of CQL apis
                Still have idiomatic clients




Thursday, February 28, 13
Drawbacks of CQL apis
                Still have idiomatic clients
                Still a binary protocol




Thursday, February 28, 13
Drawbacks of CQL apis
                Still have idiomatic clients
                Still a binary protocol
                Default storage model
                emposes substantial
                restrictions
                ** see gotchas section later
Thursday, February 28, 13
Considerations for your
                app




Thursday, February 28, 13
Stick with Thrift if...




Thursday, February 28, 13
Heavy update
                workloads




Thursday, February 28, 13
Large, dynamic batch
                insertions




Thursday, February 28, 13
Hadoop integration
                (CASSANDRA-4421)




Thursday, February 28, 13
Commonly deal with
                very wide rows
                (CASSANDRA-4176)




Thursday, February 28, 13
CASSANDRA-4176:
                “Pick your shard keys
                carefully”




Thursday, February 28, 13
Thursday, February 28, 13
Consider CQL if...




Thursday, February 28, 13
Static column family
                model:
                Take advantage of
                stored procedures for
                common reads

Thursday, February 28, 13
Despite the shard key
                jab, CQL makes good
                use of the storage
                model


Thursday, February 28, 13
You can replace some
                custom serialization
                with collections	



Thursday, February 28, 13
Integration with JDBC
                and/or BI tools




Thursday, February 28, 13
Wire efficient:
                Does not return
                timestamp or TTL by
                default


Thursday, February 28, 13
Larger, potentially more
                transient evironments




Thursday, February 28, 13
But CQL is
                - new
                - an abstraction



Thursday, February 28, 13
In some cases, CQL
                might not do what you
                think



Thursday, February 28, 13
Most common CQL
                            pitfalls




Thursday, February 28, 13
Collections can only
                            be retrieved in their
                            entirety



Thursday, February 28, 13
Can’t mix static and
                            dynamic data in a
                            column family



Thursday, February 28, 13
“keys only” range
                            slices don’t work
                            (CASSANDRA-4536)




Thursday, February 28, 13
Range ghosts will not
                            be returned




Thursday, February 28, 13
Batch inserts are
                            clunky
                            (CASSANDRA-4693)




Thursday, February 28, 13
With non-compact
                storage the whole row
                must be read every
                time.


Thursday, February 28, 13
The take away is that
                you have options.
                Particularly good ones
                for Java.


Thursday, February 28, 13
Thursday, February 28, 13
BUT




Thursday, February 28, 13
there is a larger, more
                fundamental problem
                to discuss



Thursday, February 28, 13
“If [they] think that CQL is the
                answer to usability then I just
                won. We at least know where
                our problems are.”
                - 10gen exec.


Thursday, February 28, 13
The market has spoken
                and we missed the
                boat.



Thursday, February 28, 13
POST /endpoint {json}




Thursday, February 28, 13
A Cassandra-MVP
                actually maintains a
                REST front-end



Thursday, February 28, 13
So we’ve taken this
                and gone further




Thursday, February 28, 13
What if...




Thursday, February 28, 13
Coming soon...
                Intravert.
                Vert.x+Cassandra.
                ASF-licensed.
                Driven by real-world
                requirements.

Thursday, February 28, 13

More Related Content

Similar to Apachecon cassandra transport

Cloud building talk
Cloud building talkCloud building talk
Cloud building talkbodepd
 
The Future of Big Data is Relational (or why you can't escape SQL)
The Future of Big Data is Relational (or why you can't escape SQL)The Future of Big Data is Relational (or why you can't escape SQL)
The Future of Big Data is Relational (or why you can't escape SQL)OReillyStrata
 
Butter Web Browsing with Margarine
Butter Web Browsing with MargarineButter Web Browsing with Margarine
Butter Web Browsing with MargarineWayne Walls
 
Cassandra EU 2012 - CQL: Then, Now and When by Eric Evans
Cassandra EU 2012 - CQL: Then, Now and When by Eric Evans Cassandra EU 2012 - CQL: Then, Now and When by Eric Evans
Cassandra EU 2012 - CQL: Then, Now and When by Eric Evans Acunu
 
Puppet: Orchestration framework?
Puppet: Orchestration framework?Puppet: Orchestration framework?
Puppet: Orchestration framework?bodepd
 
Conexao Java: Criando uma App Android
Conexao Java: Criando uma App AndroidConexao Java: Criando uma App Android
Conexao Java: Criando uma App AndroidErich Egert
 
DevOps Jungle of Tools, Ran Tavory
DevOps Jungle of Tools, Ran TavoryDevOps Jungle of Tools, Ran Tavory
DevOps Jungle of Tools, Ran TavoryDevOpsDays Tel Aviv
 
Mobile API Design Techniques
Mobile API Design TechniquesMobile API Design Techniques
Mobile API Design TechniquesTrieu Nguyen
 
Modules and the Puppet Forge
Modules and the Puppet ForgeModules and the Puppet Forge
Modules and the Puppet ForgePuppet
 
Travis CI – what's inside?
Travis CI – what's inside?Travis CI – what's inside?
Travis CI – what's inside?Olga Lavrentieva
 

Similar to Apachecon cassandra transport (11)

Cloud building talk
Cloud building talkCloud building talk
Cloud building talk
 
The Future of Big Data is Relational (or why you can't escape SQL)
The Future of Big Data is Relational (or why you can't escape SQL)The Future of Big Data is Relational (or why you can't escape SQL)
The Future of Big Data is Relational (or why you can't escape SQL)
 
Butter Web Browsing with Margarine
Butter Web Browsing with MargarineButter Web Browsing with Margarine
Butter Web Browsing with Margarine
 
Cassandra EU 2012 - CQL: Then, Now and When by Eric Evans
Cassandra EU 2012 - CQL: Then, Now and When by Eric Evans Cassandra EU 2012 - CQL: Then, Now and When by Eric Evans
Cassandra EU 2012 - CQL: Then, Now and When by Eric Evans
 
Puppet: Orchestration framework?
Puppet: Orchestration framework?Puppet: Orchestration framework?
Puppet: Orchestration framework?
 
Docker intro
Docker introDocker intro
Docker intro
 
Conexao Java: Criando uma App Android
Conexao Java: Criando uma App AndroidConexao Java: Criando uma App Android
Conexao Java: Criando uma App Android
 
DevOps Jungle of Tools, Ran Tavory
DevOps Jungle of Tools, Ran TavoryDevOps Jungle of Tools, Ran Tavory
DevOps Jungle of Tools, Ran Tavory
 
Mobile API Design Techniques
Mobile API Design TechniquesMobile API Design Techniques
Mobile API Design Techniques
 
Modules and the Puppet Forge
Modules and the Puppet ForgeModules and the Puppet Forge
Modules and the Puppet Forge
 
Travis CI – what's inside?
Travis CI – what's inside?Travis CI – what's inside?
Travis CI – what's inside?
 

More from zznate

Seattle C* Meetup: Hardening cassandra for compliance or paranoia
Seattle C* Meetup: Hardening cassandra for compliance or paranoiaSeattle C* Meetup: Hardening cassandra for compliance or paranoia
Seattle C* Meetup: Hardening cassandra for compliance or paranoiazznate
 
Hardening cassandra for compliance or paranoia
Hardening cassandra for compliance or paranoiaHardening cassandra for compliance or paranoia
Hardening cassandra for compliance or paranoiazznate
 
Successful Software Development with Apache Cassandra
Successful Software Development with Apache CassandraSuccessful Software Development with Apache Cassandra
Successful Software Development with Apache Cassandrazznate
 
Stampede con 2014 cassandra in the real world
Stampede con 2014   cassandra in the real worldStampede con 2014   cassandra in the real world
Stampede con 2014 cassandra in the real worldzznate
 
An Introduction to the Vert.x framework
An Introduction to the Vert.x frameworkAn Introduction to the Vert.x framework
An Introduction to the Vert.x frameworkzznate
 
Oscon 2012 tdd_cassandra
Oscon 2012 tdd_cassandraOscon 2012 tdd_cassandra
Oscon 2012 tdd_cassandrazznate
 
Strata west 2012_java_cassandra
Strata west 2012_java_cassandraStrata west 2012_java_cassandra
Strata west 2012_java_cassandrazznate
 
Nyc summit intro_to_cassandra
Nyc summit intro_to_cassandraNyc summit intro_to_cassandra
Nyc summit intro_to_cassandrazznate
 
Meetup cassandra sfo_jdbc
Meetup cassandra sfo_jdbcMeetup cassandra sfo_jdbc
Meetup cassandra sfo_jdbczznate
 
Meetup cassandra for_java_cql
Meetup cassandra for_java_cqlMeetup cassandra for_java_cql
Meetup cassandra for_java_cqlzznate
 
Introduciton to Apache Cassandra for Java Developers (JavaOne)
Introduciton to Apache Cassandra for Java Developers (JavaOne)Introduciton to Apache Cassandra for Java Developers (JavaOne)
Introduciton to Apache Cassandra for Java Developers (JavaOne)zznate
 
Introduction to apache_cassandra_for_developers-lhg
Introduction to apache_cassandra_for_developers-lhgIntroduction to apache_cassandra_for_developers-lhg
Introduction to apache_cassandra_for_developers-lhgzznate
 
Introduction to apache_cassandra_for_develope
Introduction to apache_cassandra_for_developeIntroduction to apache_cassandra_for_develope
Introduction to apache_cassandra_for_developezznate
 
Hector v2: The Second Version of the Popular High-Level Java Client for Apach...
Hector v2: The Second Version of the Popular High-Level Java Client for Apach...Hector v2: The Second Version of the Popular High-Level Java Client for Apach...
Hector v2: The Second Version of the Popular High-Level Java Client for Apach...zznate
 

More from zznate (14)

Seattle C* Meetup: Hardening cassandra for compliance or paranoia
Seattle C* Meetup: Hardening cassandra for compliance or paranoiaSeattle C* Meetup: Hardening cassandra for compliance or paranoia
Seattle C* Meetup: Hardening cassandra for compliance or paranoia
 
Hardening cassandra for compliance or paranoia
Hardening cassandra for compliance or paranoiaHardening cassandra for compliance or paranoia
Hardening cassandra for compliance or paranoia
 
Successful Software Development with Apache Cassandra
Successful Software Development with Apache CassandraSuccessful Software Development with Apache Cassandra
Successful Software Development with Apache Cassandra
 
Stampede con 2014 cassandra in the real world
Stampede con 2014   cassandra in the real worldStampede con 2014   cassandra in the real world
Stampede con 2014 cassandra in the real world
 
An Introduction to the Vert.x framework
An Introduction to the Vert.x frameworkAn Introduction to the Vert.x framework
An Introduction to the Vert.x framework
 
Oscon 2012 tdd_cassandra
Oscon 2012 tdd_cassandraOscon 2012 tdd_cassandra
Oscon 2012 tdd_cassandra
 
Strata west 2012_java_cassandra
Strata west 2012_java_cassandraStrata west 2012_java_cassandra
Strata west 2012_java_cassandra
 
Nyc summit intro_to_cassandra
Nyc summit intro_to_cassandraNyc summit intro_to_cassandra
Nyc summit intro_to_cassandra
 
Meetup cassandra sfo_jdbc
Meetup cassandra sfo_jdbcMeetup cassandra sfo_jdbc
Meetup cassandra sfo_jdbc
 
Meetup cassandra for_java_cql
Meetup cassandra for_java_cqlMeetup cassandra for_java_cql
Meetup cassandra for_java_cql
 
Introduciton to Apache Cassandra for Java Developers (JavaOne)
Introduciton to Apache Cassandra for Java Developers (JavaOne)Introduciton to Apache Cassandra for Java Developers (JavaOne)
Introduciton to Apache Cassandra for Java Developers (JavaOne)
 
Introduction to apache_cassandra_for_developers-lhg
Introduction to apache_cassandra_for_developers-lhgIntroduction to apache_cassandra_for_developers-lhg
Introduction to apache_cassandra_for_developers-lhg
 
Introduction to apache_cassandra_for_develope
Introduction to apache_cassandra_for_developeIntroduction to apache_cassandra_for_develope
Introduction to apache_cassandra_for_develope
 
Hector v2: The Second Version of the Popular High-Level Java Client for Apach...
Hector v2: The Second Version of the Popular High-Level Java Client for Apach...Hector v2: The Second Version of the Popular High-Level Java Client for Apach...
Hector v2: The Second Version of the Popular High-Level Java Client for Apach...
 

Apachecon cassandra transport