SlideShare una empresa de Scribd logo
1 de 28
Descargar para leer sin conexión
New Cassandra Drivers in
Depth

Michaël Figuière
@mfiguiere
Speaker

                 Michaël Figuière




                      @mfiguiere


©2012 DataStax                      2
CQL: the new face of Cassandra

     • CQL 3
           •     Simpler Data Model using denormalized Tables
           •     SQL-like query language
           •     Schema definition


     • CQL Binary Protocol
           •     Introduced in Cassandra 1.2 (CASSANDRA-2478)
           •     Designed for CQL 3
           •     Opens doors for Streaming, Notifications, ...
           •     Thrift will keep being supported by Cassandra
©2012 DataStax                                                   3
CQL3 Denormalized Model
           CQL3 Query Language comes with a new Data Model abstraction made of
                          denormalized, statically defined tables




                           Data duplicated over several tables

©2012 DataStax                                                                   4
CQL3 Data Model
    Timeline Table
         user_id     tweet_id       author                       body
         gmason        1735         phenry      Give me liberty or give me death
         gmason        1742       gwashington   I chopped down the cherry tree
       ahamilton       1767         jadams      A government of laws, not men
       ahamilton       1794       gwashington   I chopped down the cherry tree

       Partition     Clustering
         Key            Key




©2012 DataStax                                                                     5
CQL3 Data Model
    Timeline Table
         user_id     tweet_id     author                       body
         gmason        1735       phenry      Give me liberty or give me death
         gmason        1742     gwashington   I chopped down the cherry tree
       ahamilton       1767       jadams      A government of laws, not men
       ahamilton       1794     gwashington   I chopped down the cherry tree


    CQL
                   CREATE TABLE timeline (
                            user_id varchar,
                            tweet_id timeuuid,
                            author varchar,
                            body varchar,
                            PRIMARY KEY (user_id, tweet_id));


©2012 DataStax                                                                   6
CQL3 Data Model
    Timeline Table
         user_id         tweet_id        author                            body
         gmason            1735          phenry       Give me liberty or give me death
         gmason            1742        gwashington    I chopped down the cherry tree
       ahamilton           1767          jadams       A government of laws, not men
       ahamilton           1794        gwashington    I chopped down the cherry tree



Timeline Physical Layout
                 [1735, author]       [1735, body]        [1742, author]          [1742, body]
   gmason
                 gwashington      I chopped down the...      phenry        Give me liberty or give...
                 [1767, author]       [1767, body]        [1794, author]          [1794, body]
 ahamilton
                 gwashington      I chopped down the...      jadams        A government of laws...


©2012 DataStax                                                                                          7
Current Drivers Architecture


      CQL API             Thrift API             OO API                        DB API


                         Thrift RPC                                         Thrift RPC


                          Client Library                                      CQL Driver



 * This is a simplified view of drivers architecture. Details vary from one language to another.
©2012 DataStax                                                                                    8
New Drivers Architecture


                 DB API                   CQL API                    OO API


                                CQL Native Protocol


                                    Next Generation Driver



 * This is a simplified view of drivers architecture. Details vary from one language to another.
©2012 DataStax                                                                                    9
DataStax Java Driver
  • Reference Implementation
  • Asynchronous architecture based on Netty
  • Prepared Statements Support
  • Automatic Fail-over
  • Node Discovery
  • Cassandra Tracing Support
  • Tunable policies
           •     LoadBalancingPolicy
           •     ReconnectionPolicy
           •
©2012 DataStax
                 RetryPolicy
                                               10
Request Pipelining
                 Client   Cassandra




                                               Without
                                      Request Pipelining

                                                  With
                 Client   Cassandra   Request Pipelining




©2012 DataStax                                        11
Notifications
                                 Node

                 Client

                          Node
                                        Node


                                              Without
                                           Notifications

                                                  With
                                           Notifications

                                 Node

                 Client

                          Node
                                        Node

©2012 DataStax                                       12
Asynchronous Architecture

                              Node
            Client
            Thread
                              Node

            Client
                     Driver
            Thread
                              Node


            Client
            Thread
                              Node




©2012 DataStax                       13
Asynchronous Architecture

                                                  Node
            Client
            Thread       6

                     1                            Node

            Client
                             Driver       2
            Thread                            3
                                                  Node
                                      5
                                              4
            Client
            Thread
                                                  Node




©2012 DataStax                                           14
LoadBalancingPolicy


                 public interface LoadBalancingPolicy {

                     HostDistance distance(Host host);

                     Iterator<Host> newQueryPlan(Query query);

                     [...]

                 }




©2012 DataStax                                                   15
DCAwareRoundRobinPolicy
                                      Datacenter A
      Local nodes are
      queried first, if non   Client              Node
      are available, the
      request will be sent   Client                     Node
      to a remote node.
                                                 Node
                             Client



                             Client              Node


                             Client                     Node


                                                 Node
                             Client

                                      Datacenter B
©2012 DataStax                                                 16
TokenAwarePolicy
      Nodes that own a
      Replica of the data
      being read or written
      by the query will be
      contacted first.
                                             Replica
                                             Node       Node




                        Client   Replica
                                 Node
                                                               Node




                                           Replica
                                                       Node


©2012 DataStax                                                        17
RetryPolicy
public interface RetryPolicy {

      RetryDecision onReadTimeout(Query query, ConsistencyLevel cl, [...] );

      RetryDecision onWriteTimeout(Query query, ConsistencyLevel cl, [...] );

      RetryDecision onUnavailable(Query query, ConsistencyLevel cl, [...] );

      public static class RetryDecision {
           public static enum Type { RETRY, RETHROW, IGNORE };

                 private final Type type;
                 private final ConsistencyLevel retryCL;

                 [...]
      }
}


©2012 DataStax                                                             18
Downgrading Consistency
      If the requested
      Consistency Level
      cannot be reached
      (QUORUM here), a
      second request with a
      lower CL is sent
      automatically.                    Node     Replica




                       Client   Node
                                                           Replica




                                       Node
                                               Replica


©2012 DataStax                                                       19
Connect and Write

       Cluster cluster = Cluster.builder()
                         .addContactPoints("10.0.0.1", "10.0.0.2")
                         .build();

       Session session = cluster.connect("myKeyspace");

       session.execute(
          "INSERT INTO user (user_id, name, email)
           VALUES (12345, 'johndoe', 'john@doe.com')"
       );




©2012 DataStax                                                       20
Read

             ResultSet rs = session.execute("SELECT * FROM test");

             List<Row> rows = rs.all();

             for (Row row : rows) {

                 String userId = row.getString("user_id");
                 String name = row.getString("name");
                 String email = row.getString("email");
             }




©2012 DataStax                                                       21
Asynchronous Read

            ResultSetFuture future =
               session.executeAsync("SELECT * FROM test");

            for (Row row : future.get()) {

                 String userId = row.getString("user_id");
                 String name = row.getString("name");
                 String email = row.getString("email");
            }




©2012 DataStax                                               22
Prepared Statements
         PreparedStatement ps =
            session.prepare("SELECT * FROM users WHERE id = ?");

         BoundStatement bs =
            session.execute(ps.bind("123")).one().getInt("age");

         bs.setString("k");

         int age = session.execute(bs).one().getInt("age");




         age = session.execute(ps.bind("123")).one().getInt("age");




©2012 DataStax                                                        23
Query Builder
      String query = "SELECT a,b,"C"
                      FROM foo
                      WHERE a IN (127.0.0.1,127.0.0.3)
                      AND "C"='foo'
                      ORDER BY a ASC,b DESC LIMIT 42;";



      Query select =
         select("a", "b", quote("C")).from("foo")
         .where(in("a", InetAddress.getByName("127.0.0.1"),
                        InetAddress.getByName("127.0.0.3")))
         .and(eq(quote("C"), "foo"))
         .orderBy(asc("a"), desc("b"))
         .limit(42);




©2012 DataStax                                                 24
Object Mapping
     @Table(name = "user")
     public class User {           public enum Gender {
     	
     	 @PartitionKey               	   @EnumValue("m")
     	 @Column(name = "user_id")   	   MALE,
     	 private String userId;      	
     	                             	   @EnumValue("f")
     	 private String name;        	   FEMALE;
     	                             }
     	 private String email;
     	
     	 private Gender gender;
     }



©2012 DataStax                                            25
Inheritance
@Table(name = "catalog")
@Inheritance(
                                          @InheritanceValue("tv")
  subClasses = {Phone.class, TV.class},
                                          public class TV
  column = "product_type"
                                          extends Product {
)
public abstract class Product {
                                          	 private float size;
                                          }
	     @Column(name = "product_id")
	     private String productId;
	
	     private float price;
	
	     private String vendor;
	
	     private String model;

}
©2012 DataStax                                                    26
Betas now available!


      https://github.com/datastax/
Stay Tuned!

          blog.datastax.com
          @mfiguiere

Más contenido relacionado

La actualidad más candente

06 response-headers
06 response-headers06 response-headers
06 response-headerssnopteck
 
Hazelcast
HazelcastHazelcast
Hazelcastoztalip
 
How Prometheus Store the Data
How Prometheus Store the DataHow Prometheus Store the Data
How Prometheus Store the DataHao Chen
 
Hazelcast Essentials
Hazelcast EssentialsHazelcast Essentials
Hazelcast EssentialsRahul Gupta
 
DataStax | Data Science with DataStax Enterprise (Brian Hess) | Cassandra Sum...
DataStax | Data Science with DataStax Enterprise (Brian Hess) | Cassandra Sum...DataStax | Data Science with DataStax Enterprise (Brian Hess) | Cassandra Sum...
DataStax | Data Science with DataStax Enterprise (Brian Hess) | Cassandra Sum...DataStax
 
Cassandra 3.0 advanced preview
Cassandra 3.0 advanced previewCassandra 3.0 advanced preview
Cassandra 3.0 advanced previewPatrick McFadin
 
Introduction to Apache ZooKeeper
Introduction to Apache ZooKeeperIntroduction to Apache ZooKeeper
Introduction to Apache ZooKeeperSaurav Haloi
 
Using Spark to Load Oracle Data into Cassandra
Using Spark to Load Oracle Data into CassandraUsing Spark to Load Oracle Data into Cassandra
Using Spark to Load Oracle Data into CassandraJim Hatcher
 
Bulk Loading into Cassandra
Bulk Loading into CassandraBulk Loading into Cassandra
Bulk Loading into CassandraBrian Hess
 
Spark Cassandra Connector: Past, Present and Furure
Spark Cassandra Connector: Past, Present and FurureSpark Cassandra Connector: Past, Present and Furure
Spark Cassandra Connector: Past, Present and FurureDataStax Academy
 
Kerberizing spark. Spark Summit east
Kerberizing spark. Spark Summit eastKerberizing spark. Spark Summit east
Kerberizing spark. Spark Summit eastJorge Lopez-Malla
 
SCWCD : Thread safe servlets : CHAP : 8
SCWCD : Thread safe servlets : CHAP : 8SCWCD : Thread safe servlets : CHAP : 8
SCWCD : Thread safe servlets : CHAP : 8Ben Abdallah Helmi
 
Apache Cassandra multi-datacenter essentials
Apache Cassandra multi-datacenter essentialsApache Cassandra multi-datacenter essentials
Apache Cassandra multi-datacenter essentialsJulien Anguenot
 
Meetup cassandra for_java_cql
Meetup cassandra for_java_cqlMeetup cassandra for_java_cql
Meetup cassandra for_java_cqlzznate
 
Introduction to data modeling with apache cassandra
Introduction to data modeling with apache cassandraIntroduction to data modeling with apache cassandra
Introduction to data modeling with apache cassandraPatrick McFadin
 
Think Distributed: The Hazelcast Way
Think Distributed: The Hazelcast WayThink Distributed: The Hazelcast Way
Think Distributed: The Hazelcast WayRahul Gupta
 
Understanding DSE Search by Matt Stump
Understanding DSE Search by Matt StumpUnderstanding DSE Search by Matt Stump
Understanding DSE Search by Matt StumpDataStax
 
Storing time series data with Apache Cassandra
Storing time series data with Apache CassandraStoring time series data with Apache Cassandra
Storing time series data with Apache CassandraPatrick McFadin
 

La actualidad más candente (20)

06 response-headers
06 response-headers06 response-headers
06 response-headers
 
Hazelcast
HazelcastHazelcast
Hazelcast
 
How Prometheus Store the Data
How Prometheus Store the DataHow Prometheus Store the Data
How Prometheus Store the Data
 
Hazelcast Essentials
Hazelcast EssentialsHazelcast Essentials
Hazelcast Essentials
 
DataStax | Data Science with DataStax Enterprise (Brian Hess) | Cassandra Sum...
DataStax | Data Science with DataStax Enterprise (Brian Hess) | Cassandra Sum...DataStax | Data Science with DataStax Enterprise (Brian Hess) | Cassandra Sum...
DataStax | Data Science with DataStax Enterprise (Brian Hess) | Cassandra Sum...
 
Cassandra 3.0 advanced preview
Cassandra 3.0 advanced previewCassandra 3.0 advanced preview
Cassandra 3.0 advanced preview
 
Introduction to Apache ZooKeeper
Introduction to Apache ZooKeeperIntroduction to Apache ZooKeeper
Introduction to Apache ZooKeeper
 
Using Spark to Load Oracle Data into Cassandra
Using Spark to Load Oracle Data into CassandraUsing Spark to Load Oracle Data into Cassandra
Using Spark to Load Oracle Data into Cassandra
 
Bulk Loading into Cassandra
Bulk Loading into CassandraBulk Loading into Cassandra
Bulk Loading into Cassandra
 
Spark Cassandra Connector: Past, Present and Furure
Spark Cassandra Connector: Past, Present and FurureSpark Cassandra Connector: Past, Present and Furure
Spark Cassandra Connector: Past, Present and Furure
 
Kerberizing spark. Spark Summit east
Kerberizing spark. Spark Summit eastKerberizing spark. Spark Summit east
Kerberizing spark. Spark Summit east
 
SCWCD : Thread safe servlets : CHAP : 8
SCWCD : Thread safe servlets : CHAP : 8SCWCD : Thread safe servlets : CHAP : 8
SCWCD : Thread safe servlets : CHAP : 8
 
Hazelcast
HazelcastHazelcast
Hazelcast
 
Apache Cassandra multi-datacenter essentials
Apache Cassandra multi-datacenter essentialsApache Cassandra multi-datacenter essentials
Apache Cassandra multi-datacenter essentials
 
Meetup cassandra for_java_cql
Meetup cassandra for_java_cqlMeetup cassandra for_java_cql
Meetup cassandra for_java_cql
 
Introduction to data modeling with apache cassandra
Introduction to data modeling with apache cassandraIntroduction to data modeling with apache cassandra
Introduction to data modeling with apache cassandra
 
Think Distributed: The Hazelcast Way
Think Distributed: The Hazelcast WayThink Distributed: The Hazelcast Way
Think Distributed: The Hazelcast Way
 
Understanding DSE Search by Matt Stump
Understanding DSE Search by Matt StumpUnderstanding DSE Search by Matt Stump
Understanding DSE Search by Matt Stump
 
Apache cassandra v4.0
Apache cassandra v4.0Apache cassandra v4.0
Apache cassandra v4.0
 
Storing time series data with Apache Cassandra
Storing time series data with Apache CassandraStoring time series data with Apache Cassandra
Storing time series data with Apache Cassandra
 

Similar a NYC* Tech Day - New Cassandra Drivers in Depth

Toronto jaspersoft meetup
Toronto jaspersoft meetupToronto jaspersoft meetup
Toronto jaspersoft meetupPatrick McFadin
 
Oracle 10g Performance: chapter 11 SQL*Net
Oracle 10g Performance: chapter 11 SQL*NetOracle 10g Performance: chapter 11 SQL*Net
Oracle 10g Performance: chapter 11 SQL*NetKyle Hailey
 
Safer restarts, faster streaming, and better repair, just a glimpse of cassan...
Safer restarts, faster streaming, and better repair, just a glimpse of cassan...Safer restarts, faster streaming, and better repair, just a glimpse of cassan...
Safer restarts, faster streaming, and better repair, just a glimpse of cassan...Vinay Kumar Chella
 
OpenStack Summit Portland April 2013 talk - Quantum and EC2
OpenStack Summit Portland April 2013 talk - Quantum and EC2OpenStack Summit Portland April 2013 talk - Quantum and EC2
OpenStack Summit Portland April 2013 talk - Quantum and EC2Naveen Joy
 
Intro to Kapacitor for Alerting and Anomaly Detection
Intro to Kapacitor for Alerting and Anomaly DetectionIntro to Kapacitor for Alerting and Anomaly Detection
Intro to Kapacitor for Alerting and Anomaly DetectionInfluxData
 
Advanced kapacitor
Advanced kapacitorAdvanced kapacitor
Advanced kapacitorInfluxData
 
Scaling DataStax in Docker
Scaling DataStax in DockerScaling DataStax in Docker
Scaling DataStax in DockerDataStax
 
Breakthrough performance with MySQL Cluster (2012)
Breakthrough performance with MySQL Cluster (2012)Breakthrough performance with MySQL Cluster (2012)
Breakthrough performance with MySQL Cluster (2012)Frazer Clement
 
Consolidated shared indexes in real time
Consolidated shared indexes in real timeConsolidated shared indexes in real time
Consolidated shared indexes in real timeJeff Mace
 
Cisco’s E-Commerce Transformation Using Kafka
Cisco’s E-Commerce Transformation Using Kafka Cisco’s E-Commerce Transformation Using Kafka
Cisco’s E-Commerce Transformation Using Kafka confluent
 
Infosys Ltd: Performance Tuning - A Key to Successful Cassandra Migration
Infosys Ltd: Performance Tuning - A Key to Successful Cassandra MigrationInfosys Ltd: Performance Tuning - A Key to Successful Cassandra Migration
Infosys Ltd: Performance Tuning - A Key to Successful Cassandra MigrationDataStax Academy
 
NoSQL Matters 2012 - Real Time Big Data in practice with Cassandra
NoSQL Matters 2012 - Real Time Big Data in practice with CassandraNoSQL Matters 2012 - Real Time Big Data in practice with Cassandra
NoSQL Matters 2012 - Real Time Big Data in practice with CassandraMichaël Figuière
 
Advanced Tools and Techniques for Troubleshooting NetScaler Appliances
Advanced Tools and Techniques for Troubleshooting NetScaler AppliancesAdvanced Tools and Techniques for Troubleshooting NetScaler Appliances
Advanced Tools and Techniques for Troubleshooting NetScaler AppliancesDavid McGeough
 
The top five questions to ask about NoSQL. JONATHAN ELLIS at Big Data Spain 2012
The top five questions to ask about NoSQL. JONATHAN ELLIS at Big Data Spain 2012The top five questions to ask about NoSQL. JONATHAN ELLIS at Big Data Spain 2012
The top five questions to ask about NoSQL. JONATHAN ELLIS at Big Data Spain 2012Big Data Spain
 
Tungsten University: Setup and Operate Tungsten Replicators
Tungsten University: Setup and Operate Tungsten ReplicatorsTungsten University: Setup and Operate Tungsten Replicators
Tungsten University: Setup and Operate Tungsten ReplicatorsContinuent
 
Simware and the new SISO LSA
Simware and the new SISO LSASimware and the new SISO LSA
Simware and the new SISO LSASimware
 
OpenStack and OpenFlow Demos
OpenStack and OpenFlow DemosOpenStack and OpenFlow Demos
OpenStack and OpenFlow DemosBrent Salisbury
 
DataStax Enterprise & Apache Cassandra – Essentials for Financial Services – ...
DataStax Enterprise & Apache Cassandra – Essentials for Financial Services – ...DataStax Enterprise & Apache Cassandra – Essentials for Financial Services – ...
DataStax Enterprise & Apache Cassandra – Essentials for Financial Services – ...Daniel Cohen
 

Similar a NYC* Tech Day - New Cassandra Drivers in Depth (20)

Toronto jaspersoft meetup
Toronto jaspersoft meetupToronto jaspersoft meetup
Toronto jaspersoft meetup
 
Oracle 10g Performance: chapter 11 SQL*Net
Oracle 10g Performance: chapter 11 SQL*NetOracle 10g Performance: chapter 11 SQL*Net
Oracle 10g Performance: chapter 11 SQL*Net
 
Safer restarts, faster streaming, and better repair, just a glimpse of cassan...
Safer restarts, faster streaming, and better repair, just a glimpse of cassan...Safer restarts, faster streaming, and better repair, just a glimpse of cassan...
Safer restarts, faster streaming, and better repair, just a glimpse of cassan...
 
OpenStack Summit Portland April 2013 talk - Quantum and EC2
OpenStack Summit Portland April 2013 talk - Quantum and EC2OpenStack Summit Portland April 2013 talk - Quantum and EC2
OpenStack Summit Portland April 2013 talk - Quantum and EC2
 
Intro to Kapacitor for Alerting and Anomaly Detection
Intro to Kapacitor for Alerting and Anomaly DetectionIntro to Kapacitor for Alerting and Anomaly Detection
Intro to Kapacitor for Alerting and Anomaly Detection
 
Advanced kapacitor
Advanced kapacitorAdvanced kapacitor
Advanced kapacitor
 
Scaling DataStax in Docker
Scaling DataStax in DockerScaling DataStax in Docker
Scaling DataStax in Docker
 
Breakthrough performance with MySQL Cluster (2012)
Breakthrough performance with MySQL Cluster (2012)Breakthrough performance with MySQL Cluster (2012)
Breakthrough performance with MySQL Cluster (2012)
 
GR740 User day
GR740 User dayGR740 User day
GR740 User day
 
DataStax 6 and Beyond
DataStax 6 and BeyondDataStax 6 and Beyond
DataStax 6 and Beyond
 
Consolidated shared indexes in real time
Consolidated shared indexes in real timeConsolidated shared indexes in real time
Consolidated shared indexes in real time
 
Cisco’s E-Commerce Transformation Using Kafka
Cisco’s E-Commerce Transformation Using Kafka Cisco’s E-Commerce Transformation Using Kafka
Cisco’s E-Commerce Transformation Using Kafka
 
Infosys Ltd: Performance Tuning - A Key to Successful Cassandra Migration
Infosys Ltd: Performance Tuning - A Key to Successful Cassandra MigrationInfosys Ltd: Performance Tuning - A Key to Successful Cassandra Migration
Infosys Ltd: Performance Tuning - A Key to Successful Cassandra Migration
 
NoSQL Matters 2012 - Real Time Big Data in practice with Cassandra
NoSQL Matters 2012 - Real Time Big Data in practice with CassandraNoSQL Matters 2012 - Real Time Big Data in practice with Cassandra
NoSQL Matters 2012 - Real Time Big Data in practice with Cassandra
 
Advanced Tools and Techniques for Troubleshooting NetScaler Appliances
Advanced Tools and Techniques for Troubleshooting NetScaler AppliancesAdvanced Tools and Techniques for Troubleshooting NetScaler Appliances
Advanced Tools and Techniques for Troubleshooting NetScaler Appliances
 
The top five questions to ask about NoSQL. JONATHAN ELLIS at Big Data Spain 2012
The top five questions to ask about NoSQL. JONATHAN ELLIS at Big Data Spain 2012The top five questions to ask about NoSQL. JONATHAN ELLIS at Big Data Spain 2012
The top five questions to ask about NoSQL. JONATHAN ELLIS at Big Data Spain 2012
 
Tungsten University: Setup and Operate Tungsten Replicators
Tungsten University: Setup and Operate Tungsten ReplicatorsTungsten University: Setup and Operate Tungsten Replicators
Tungsten University: Setup and Operate Tungsten Replicators
 
Simware and the new SISO LSA
Simware and the new SISO LSASimware and the new SISO LSA
Simware and the new SISO LSA
 
OpenStack and OpenFlow Demos
OpenStack and OpenFlow DemosOpenStack and OpenFlow Demos
OpenStack and OpenFlow Demos
 
DataStax Enterprise & Apache Cassandra – Essentials for Financial Services – ...
DataStax Enterprise & Apache Cassandra – Essentials for Financial Services – ...DataStax Enterprise & Apache Cassandra – Essentials for Financial Services – ...
DataStax Enterprise & Apache Cassandra – Essentials for Financial Services – ...
 

Más de Michaël Figuière

Cassandra summit 2013 - DataStax Java Driver Unleashed!
Cassandra summit 2013 - DataStax Java Driver Unleashed!Cassandra summit 2013 - DataStax Java Driver Unleashed!
Cassandra summit 2013 - DataStax Java Driver Unleashed!Michaël Figuière
 
ApacheCon Europe 2012 - Real Time Big Data in practice with Cassandra
ApacheCon Europe 2012 - Real Time Big Data in practice with CassandraApacheCon Europe 2012 - Real Time Big Data in practice with Cassandra
ApacheCon Europe 2012 - Real Time Big Data in practice with CassandraMichaël Figuière
 
GTUG Nantes (Dec 2011) - BigTable et NoSQL
GTUG Nantes (Dec 2011) - BigTable et NoSQLGTUG Nantes (Dec 2011) - BigTable et NoSQL
GTUG Nantes (Dec 2011) - BigTable et NoSQLMichaël Figuière
 
Duchess France (Nov 2011) - Atelier Apache Mahout
Duchess France (Nov 2011) - Atelier Apache MahoutDuchess France (Nov 2011) - Atelier Apache Mahout
Duchess France (Nov 2011) - Atelier Apache MahoutMichaël Figuière
 
JUG Summer Camp (Sep 2011) - Les applications et architectures d’entreprise d...
JUG Summer Camp (Sep 2011) - Les applications et architectures d’entreprise d...JUG Summer Camp (Sep 2011) - Les applications et architectures d’entreprise d...
JUG Summer Camp (Sep 2011) - Les applications et architectures d’entreprise d...Michaël Figuière
 
BreizhCamp (Jun 2011) - Haute disponibilité et élasticité avec Cassandra
BreizhCamp (Jun 2011) - Haute disponibilité et élasticité avec CassandraBreizhCamp (Jun 2011) - Haute disponibilité et élasticité avec Cassandra
BreizhCamp (Jun 2011) - Haute disponibilité et élasticité avec CassandraMichaël Figuière
 
Mix-IT (Apr 2011) - Intelligence Collective avec Apache Mahout
Mix-IT (Apr 2011) - Intelligence Collective avec Apache MahoutMix-IT (Apr 2011) - Intelligence Collective avec Apache Mahout
Mix-IT (Apr 2011) - Intelligence Collective avec Apache MahoutMichaël Figuière
 
Xebia Knowledge Exchange (mars 2011) - Machine Learning with Apache Mahout
Xebia Knowledge Exchange (mars 2011) - Machine Learning with Apache MahoutXebia Knowledge Exchange (mars 2011) - Machine Learning with Apache Mahout
Xebia Knowledge Exchange (mars 2011) - Machine Learning with Apache MahoutMichaël Figuière
 
Breizh JUG (mar 2011) - NoSQL : Des Grands du Web aux Entreprises
Breizh JUG (mar 2011) - NoSQL : Des Grands du Web aux EntreprisesBreizh JUG (mar 2011) - NoSQL : Des Grands du Web aux Entreprises
Breizh JUG (mar 2011) - NoSQL : Des Grands du Web aux EntreprisesMichaël Figuière
 
FOSDEM (feb 2011) - A real-time search engine with Lucene and S4
FOSDEM (feb 2011) -  A real-time search engine with Lucene and S4FOSDEM (feb 2011) -  A real-time search engine with Lucene and S4
FOSDEM (feb 2011) - A real-time search engine with Lucene and S4Michaël Figuière
 
Xebia Knowledge Exchange (feb 2011) - Large Scale Web Development
Xebia Knowledge Exchange (feb 2011) - Large Scale Web DevelopmentXebia Knowledge Exchange (feb 2011) - Large Scale Web Development
Xebia Knowledge Exchange (feb 2011) - Large Scale Web DevelopmentMichaël Figuière
 
Xebia Knowledge Exchange (jan 2011) - Trends in Enterprise Applications Archi...
Xebia Knowledge Exchange (jan 2011) - Trends in Enterprise Applications Archi...Xebia Knowledge Exchange (jan 2011) - Trends in Enterprise Applications Archi...
Xebia Knowledge Exchange (jan 2011) - Trends in Enterprise Applications Archi...Michaël Figuière
 
Lorraine JUG (dec 2010) - NoSQL, des grands du Web aux entreprises
Lorraine JUG (dec 2010) - NoSQL, des grands du Web aux entreprisesLorraine JUG (dec 2010) - NoSQL, des grands du Web aux entreprises
Lorraine JUG (dec 2010) - NoSQL, des grands du Web aux entreprisesMichaël Figuière
 
Tours JUG (oct 2010) - NoSQL, des grands du Web aux entreprises
Tours JUG (oct 2010) - NoSQL, des grands du Web aux entreprisesTours JUG (oct 2010) - NoSQL, des grands du Web aux entreprises
Tours JUG (oct 2010) - NoSQL, des grands du Web aux entreprisesMichaël Figuière
 
Paris JUG (sept 2010) - NoSQL : Des concepts à la réalité
Paris JUG (sept 2010) - NoSQL : Des concepts à la réalitéParis JUG (sept 2010) - NoSQL : Des concepts à la réalité
Paris JUG (sept 2010) - NoSQL : Des concepts à la réalitéMichaël Figuière
 
Xebia Knowledge Exchange (mars 2010) - Lucene : From theory to real world
Xebia Knowledge Exchange (mars 2010) - Lucene : From theory to real worldXebia Knowledge Exchange (mars 2010) - Lucene : From theory to real world
Xebia Knowledge Exchange (mars 2010) - Lucene : From theory to real worldMichaël Figuière
 
Xebia Knowledge Exchange (may 2010) - NoSQL : Using the right tool for the ri...
Xebia Knowledge Exchange (may 2010) - NoSQL : Using the right tool for the ri...Xebia Knowledge Exchange (may 2010) - NoSQL : Using the right tool for the ri...
Xebia Knowledge Exchange (may 2010) - NoSQL : Using the right tool for the ri...Michaël Figuière
 

Más de Michaël Figuière (17)

Cassandra summit 2013 - DataStax Java Driver Unleashed!
Cassandra summit 2013 - DataStax Java Driver Unleashed!Cassandra summit 2013 - DataStax Java Driver Unleashed!
Cassandra summit 2013 - DataStax Java Driver Unleashed!
 
ApacheCon Europe 2012 - Real Time Big Data in practice with Cassandra
ApacheCon Europe 2012 - Real Time Big Data in practice with CassandraApacheCon Europe 2012 - Real Time Big Data in practice with Cassandra
ApacheCon Europe 2012 - Real Time Big Data in practice with Cassandra
 
GTUG Nantes (Dec 2011) - BigTable et NoSQL
GTUG Nantes (Dec 2011) - BigTable et NoSQLGTUG Nantes (Dec 2011) - BigTable et NoSQL
GTUG Nantes (Dec 2011) - BigTable et NoSQL
 
Duchess France (Nov 2011) - Atelier Apache Mahout
Duchess France (Nov 2011) - Atelier Apache MahoutDuchess France (Nov 2011) - Atelier Apache Mahout
Duchess France (Nov 2011) - Atelier Apache Mahout
 
JUG Summer Camp (Sep 2011) - Les applications et architectures d’entreprise d...
JUG Summer Camp (Sep 2011) - Les applications et architectures d’entreprise d...JUG Summer Camp (Sep 2011) - Les applications et architectures d’entreprise d...
JUG Summer Camp (Sep 2011) - Les applications et architectures d’entreprise d...
 
BreizhCamp (Jun 2011) - Haute disponibilité et élasticité avec Cassandra
BreizhCamp (Jun 2011) - Haute disponibilité et élasticité avec CassandraBreizhCamp (Jun 2011) - Haute disponibilité et élasticité avec Cassandra
BreizhCamp (Jun 2011) - Haute disponibilité et élasticité avec Cassandra
 
Mix-IT (Apr 2011) - Intelligence Collective avec Apache Mahout
Mix-IT (Apr 2011) - Intelligence Collective avec Apache MahoutMix-IT (Apr 2011) - Intelligence Collective avec Apache Mahout
Mix-IT (Apr 2011) - Intelligence Collective avec Apache Mahout
 
Xebia Knowledge Exchange (mars 2011) - Machine Learning with Apache Mahout
Xebia Knowledge Exchange (mars 2011) - Machine Learning with Apache MahoutXebia Knowledge Exchange (mars 2011) - Machine Learning with Apache Mahout
Xebia Knowledge Exchange (mars 2011) - Machine Learning with Apache Mahout
 
Breizh JUG (mar 2011) - NoSQL : Des Grands du Web aux Entreprises
Breizh JUG (mar 2011) - NoSQL : Des Grands du Web aux EntreprisesBreizh JUG (mar 2011) - NoSQL : Des Grands du Web aux Entreprises
Breizh JUG (mar 2011) - NoSQL : Des Grands du Web aux Entreprises
 
FOSDEM (feb 2011) - A real-time search engine with Lucene and S4
FOSDEM (feb 2011) -  A real-time search engine with Lucene and S4FOSDEM (feb 2011) -  A real-time search engine with Lucene and S4
FOSDEM (feb 2011) - A real-time search engine with Lucene and S4
 
Xebia Knowledge Exchange (feb 2011) - Large Scale Web Development
Xebia Knowledge Exchange (feb 2011) - Large Scale Web DevelopmentXebia Knowledge Exchange (feb 2011) - Large Scale Web Development
Xebia Knowledge Exchange (feb 2011) - Large Scale Web Development
 
Xebia Knowledge Exchange (jan 2011) - Trends in Enterprise Applications Archi...
Xebia Knowledge Exchange (jan 2011) - Trends in Enterprise Applications Archi...Xebia Knowledge Exchange (jan 2011) - Trends in Enterprise Applications Archi...
Xebia Knowledge Exchange (jan 2011) - Trends in Enterprise Applications Archi...
 
Lorraine JUG (dec 2010) - NoSQL, des grands du Web aux entreprises
Lorraine JUG (dec 2010) - NoSQL, des grands du Web aux entreprisesLorraine JUG (dec 2010) - NoSQL, des grands du Web aux entreprises
Lorraine JUG (dec 2010) - NoSQL, des grands du Web aux entreprises
 
Tours JUG (oct 2010) - NoSQL, des grands du Web aux entreprises
Tours JUG (oct 2010) - NoSQL, des grands du Web aux entreprisesTours JUG (oct 2010) - NoSQL, des grands du Web aux entreprises
Tours JUG (oct 2010) - NoSQL, des grands du Web aux entreprises
 
Paris JUG (sept 2010) - NoSQL : Des concepts à la réalité
Paris JUG (sept 2010) - NoSQL : Des concepts à la réalitéParis JUG (sept 2010) - NoSQL : Des concepts à la réalité
Paris JUG (sept 2010) - NoSQL : Des concepts à la réalité
 
Xebia Knowledge Exchange (mars 2010) - Lucene : From theory to real world
Xebia Knowledge Exchange (mars 2010) - Lucene : From theory to real worldXebia Knowledge Exchange (mars 2010) - Lucene : From theory to real world
Xebia Knowledge Exchange (mars 2010) - Lucene : From theory to real world
 
Xebia Knowledge Exchange (may 2010) - NoSQL : Using the right tool for the ri...
Xebia Knowledge Exchange (may 2010) - NoSQL : Using the right tool for the ri...Xebia Knowledge Exchange (may 2010) - NoSQL : Using the right tool for the ri...
Xebia Knowledge Exchange (may 2010) - NoSQL : Using the right tool for the ri...
 

Último

AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarPrecisely
 
Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxMatsuo Lab
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Will Schroeder
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UbiTrack UK
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024D Cloud Solutions
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintMahmoud Rabie
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Commit University
 
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsIgniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsSafe Software
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1DianaGray10
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemAsko Soukka
 
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IES VE
 
UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPathCommunity
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDELiveplex
 
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfIaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfDaniel Santiago Silva Capera
 
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...DianaGray10
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...Aggregage
 
Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesDavid Newbury
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfDianaGray10
 

Último (20)

AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity Webinar
 
Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptx
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
 
20230104 - machine vision
20230104 - machine vision20230104 - machine vision
20230104 - machine vision
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership Blueprint
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)
 
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsIgniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystem
 
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
 
20150722 - AGV
20150722 - AGV20150722 - AGV
20150722 - AGV
 
UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation Developers
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
 
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfIaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
 
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
 
Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond Ontologies
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
 

NYC* Tech Day - New Cassandra Drivers in Depth

  • 1. New Cassandra Drivers in Depth Michaël Figuière @mfiguiere
  • 2. Speaker Michaël Figuière @mfiguiere ©2012 DataStax 2
  • 3. CQL: the new face of Cassandra • CQL 3 • Simpler Data Model using denormalized Tables • SQL-like query language • Schema definition • CQL Binary Protocol • Introduced in Cassandra 1.2 (CASSANDRA-2478) • Designed for CQL 3 • Opens doors for Streaming, Notifications, ... • Thrift will keep being supported by Cassandra ©2012 DataStax 3
  • 4. CQL3 Denormalized Model CQL3 Query Language comes with a new Data Model abstraction made of denormalized, statically defined tables Data duplicated over several tables ©2012 DataStax 4
  • 5. CQL3 Data Model Timeline Table user_id tweet_id author body gmason 1735 phenry Give me liberty or give me death gmason 1742 gwashington I chopped down the cherry tree ahamilton 1767 jadams A government of laws, not men ahamilton 1794 gwashington I chopped down the cherry tree Partition Clustering Key Key ©2012 DataStax 5
  • 6. CQL3 Data Model Timeline Table user_id tweet_id author body gmason 1735 phenry Give me liberty or give me death gmason 1742 gwashington I chopped down the cherry tree ahamilton 1767 jadams A government of laws, not men ahamilton 1794 gwashington I chopped down the cherry tree CQL CREATE TABLE timeline ( user_id varchar, tweet_id timeuuid, author varchar, body varchar, PRIMARY KEY (user_id, tweet_id)); ©2012 DataStax 6
  • 7. CQL3 Data Model Timeline Table user_id tweet_id author body gmason 1735 phenry Give me liberty or give me death gmason 1742 gwashington I chopped down the cherry tree ahamilton 1767 jadams A government of laws, not men ahamilton 1794 gwashington I chopped down the cherry tree Timeline Physical Layout [1735, author] [1735, body] [1742, author] [1742, body] gmason gwashington I chopped down the... phenry Give me liberty or give... [1767, author] [1767, body] [1794, author] [1794, body] ahamilton gwashington I chopped down the... jadams A government of laws... ©2012 DataStax 7
  • 8. Current Drivers Architecture CQL API Thrift API OO API DB API Thrift RPC Thrift RPC Client Library CQL Driver * This is a simplified view of drivers architecture. Details vary from one language to another. ©2012 DataStax 8
  • 9. New Drivers Architecture DB API CQL API OO API CQL Native Protocol Next Generation Driver * This is a simplified view of drivers architecture. Details vary from one language to another. ©2012 DataStax 9
  • 10. DataStax Java Driver • Reference Implementation • Asynchronous architecture based on Netty • Prepared Statements Support • Automatic Fail-over • Node Discovery • Cassandra Tracing Support • Tunable policies • LoadBalancingPolicy • ReconnectionPolicy • ©2012 DataStax RetryPolicy 10
  • 11. Request Pipelining Client Cassandra Without Request Pipelining With Client Cassandra Request Pipelining ©2012 DataStax 11
  • 12. Notifications Node Client Node Node Without Notifications With Notifications Node Client Node Node ©2012 DataStax 12
  • 13. Asynchronous Architecture Node Client Thread Node Client Driver Thread Node Client Thread Node ©2012 DataStax 13
  • 14. Asynchronous Architecture Node Client Thread 6 1 Node Client Driver 2 Thread 3 Node 5 4 Client Thread Node ©2012 DataStax 14
  • 15. LoadBalancingPolicy public interface LoadBalancingPolicy { HostDistance distance(Host host); Iterator<Host> newQueryPlan(Query query); [...] } ©2012 DataStax 15
  • 16. DCAwareRoundRobinPolicy Datacenter A Local nodes are queried first, if non Client Node are available, the request will be sent Client Node to a remote node. Node Client Client Node Client Node Node Client Datacenter B ©2012 DataStax 16
  • 17. TokenAwarePolicy Nodes that own a Replica of the data being read or written by the query will be contacted first. Replica Node Node Client Replica Node Node Replica Node ©2012 DataStax 17
  • 18. RetryPolicy public interface RetryPolicy { RetryDecision onReadTimeout(Query query, ConsistencyLevel cl, [...] ); RetryDecision onWriteTimeout(Query query, ConsistencyLevel cl, [...] ); RetryDecision onUnavailable(Query query, ConsistencyLevel cl, [...] ); public static class RetryDecision { public static enum Type { RETRY, RETHROW, IGNORE }; private final Type type; private final ConsistencyLevel retryCL; [...] } } ©2012 DataStax 18
  • 19. Downgrading Consistency If the requested Consistency Level cannot be reached (QUORUM here), a second request with a lower CL is sent automatically. Node Replica Client Node Replica Node Replica ©2012 DataStax 19
  • 20. Connect and Write Cluster cluster = Cluster.builder() .addContactPoints("10.0.0.1", "10.0.0.2") .build(); Session session = cluster.connect("myKeyspace"); session.execute( "INSERT INTO user (user_id, name, email) VALUES (12345, 'johndoe', 'john@doe.com')" ); ©2012 DataStax 20
  • 21. Read ResultSet rs = session.execute("SELECT * FROM test"); List<Row> rows = rs.all(); for (Row row : rows) { String userId = row.getString("user_id"); String name = row.getString("name"); String email = row.getString("email"); } ©2012 DataStax 21
  • 22. Asynchronous Read ResultSetFuture future = session.executeAsync("SELECT * FROM test"); for (Row row : future.get()) { String userId = row.getString("user_id"); String name = row.getString("name"); String email = row.getString("email"); } ©2012 DataStax 22
  • 23. Prepared Statements PreparedStatement ps = session.prepare("SELECT * FROM users WHERE id = ?"); BoundStatement bs = session.execute(ps.bind("123")).one().getInt("age"); bs.setString("k"); int age = session.execute(bs).one().getInt("age"); age = session.execute(ps.bind("123")).one().getInt("age"); ©2012 DataStax 23
  • 24. Query Builder String query = "SELECT a,b,"C" FROM foo WHERE a IN (127.0.0.1,127.0.0.3) AND "C"='foo' ORDER BY a ASC,b DESC LIMIT 42;"; Query select = select("a", "b", quote("C")).from("foo") .where(in("a", InetAddress.getByName("127.0.0.1"), InetAddress.getByName("127.0.0.3"))) .and(eq(quote("C"), "foo")) .orderBy(asc("a"), desc("b")) .limit(42); ©2012 DataStax 24
  • 25. Object Mapping @Table(name = "user") public class User { public enum Gender { @PartitionKey @EnumValue("m") @Column(name = "user_id") MALE, private String userId; @EnumValue("f") private String name; FEMALE; } private String email; private Gender gender; } ©2012 DataStax 25
  • 26. Inheritance @Table(name = "catalog") @Inheritance( @InheritanceValue("tv") subClasses = {Phone.class, TV.class}, public class TV column = "product_type" extends Product { ) public abstract class Product { private float size; } @Column(name = "product_id") private String productId; private float price; private String vendor; private String model; } ©2012 DataStax 26
  • 27. Betas now available! https://github.com/datastax/
  • 28. Stay Tuned! blog.datastax.com @mfiguiere