SlideShare ist ein Scribd-Unternehmen logo
1 von 32
Downloaden Sie, um offline zu lesen
The new face of Cassandra

Michaël Figuière
@mfiguiere
Speaker

                 Michaël Figuière




                      @mfiguiere


©2012 DataStax                      2
Ring Architecture


                        Node     Node




                 Node     Cassandra     Node




                        Node
                                Node




©2012 DataStax                                 3
Ring Architecture


                         Node     Replica




                 Node
                                            Replica




                        Node
                                Replica




©2012 DataStax                                        4
Linear Scalability
                 Client Writes/s by Node Count - Replication Factor = 3




©2012 DataStax                                                            5
Client / Server Communication

          Client   ?           Node     Replica



          Client

                       Node
                                                  Replica
          Client


                              Node
          Client                      Replica




©2012 DataStax                                              6
Client / Server Communication

          Client           Node         Replica



          Client

                   Node
                                                  Replica
          Client


                          Node
          Client                      Replica




                   Coordinator node:
                   Forwards all R/W requests
                   to corresponding replicas
©2012 DataStax                                              7
Tunable Consistency
                                    Time


                        A   A   A


           3 replicas




©2012 DataStax                             8
Tunable Consistency
                                                            Time


                        A   A      A


                        B   A      A


            Write ‘B’




                                    Write and wait for
                                acknowledge from one node
©2012 DataStax                                                     9
Tunable Consistency
                                                                  Time
                               R +W < N
                          A       A       A


                          B       A       A


                          B       A       A




   Read waiting for one node              Write and wait for
          to answer                   acknowledge from one node
©2012 DataStax                                                       10
Tunable Consistency
                                                                    Time
                               R +W = N
                          A       A       A


                          B       B       A


                          B       B       A




   Read waiting for one node               Write and wait for
          to answer                   acknowledges from two nodes
©2012 DataStax                                                         11
Tunable Consistency
                                                                    Time
                               R +W > N
                         A        A       A


                         B        B       A


                         B        B       A




  Read waiting for two nodes               Write and wait for
          to answer                   acknowledges from two nodes
©2012 DataStax                                                         12
Tunable Consistency
                                        Time
                  R = W = QUORUM
                   A      A      A


                   B      B      A


                   B      B      A




                 QUORUM = (N / 2) + 1


©2012 DataStax                             13
Request Path
                       1
          Client                   Node             Replica
                                              2

                                                   3
          Client
                   4                                    2
                           Node
                                                              Replica
                                                        3
          Client
                                                    2
                                          3
                                  Node
          Client                                  Replica




                           Coordinator node

©2012 DataStax                                                          14
Multi-Datacenter
                                              Datacenter A

                                                 Node 1


                        Node    Node             Node 2
                         1       2

                                              Datacenter B

                                                 Node 3
                 Node
                  6                    Node
                                        3        Node 4


                                              Datacenter C
                        Node
                               Node
                         5                       Node 5
                                4
                                                 Node 6




©2012 DataStax                                               15
Column Family Data Model


                             address       email         name          state
                  jbellis
                             123 main   jb@ds.com      Jonathan        TX
                             address       email         name          state
                  dhutch
                            45 2nd st   dh@ds.com        Daria         CA
                              email        name
                 egilmore
                            eg@ds.com       Eric


                 Row Key        Columns = List of K/V pairs sorted by Key




©2012 DataStax                                                                 16
Column Family Data Model


                            datastax     dhutch       egilmore      mzcassie
                  jbellis

                            egilmore
                  dhutch

                            datastax    mzcassie
                 egilmore



                 Row Key       Columns = List of K/V pairs sorted by Key




©2012 DataStax                                                                 17
Storage Engine


                 Memtable   Memtable




                 Commit
                                       SSTable
                  Log       SSTable     SSTable
                                         SSTable


©2012 DataStax                                     18
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                                                                   19
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                                                                     20
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                                                                   21
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                                                                                          22
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                                                                                    23
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                                                                                    24
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
                                               25
Connect and Write

       Cluster cluster = new 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                                                       26
Read

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

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

             for (Row row : rows) {

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




©2012 DataStax                                                       27
Asynchronous Read

            ResultSet.Future 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                                               28
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                                            29
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                                                    30
Now Available!


  https://github.com/datastax/java-driver
Stay Tuned!

          blog.datastax.com
          @mfiguiere

Weitere ähnliche Inhalte

Mehr von Michaël Figuière

NYC* Tech Day - New Cassandra Drivers in Depth
NYC* Tech Day - New Cassandra Drivers in DepthNYC* Tech Day - New Cassandra Drivers in Depth
NYC* Tech Day - New Cassandra Drivers in DepthMichaël Figuière
 
Paris Cassandra Meetup - Overview of New Cassandra Drivers
Paris Cassandra Meetup - Overview of New Cassandra DriversParis Cassandra Meetup - Overview of New Cassandra Drivers
Paris Cassandra Meetup - Overview of New Cassandra DriversMichaë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
 
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
 
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
 

Mehr von Michaël Figuière (19)

NYC* Tech Day - New Cassandra Drivers in Depth
NYC* Tech Day - New Cassandra Drivers in DepthNYC* Tech Day - New Cassandra Drivers in Depth
NYC* Tech Day - New Cassandra Drivers in Depth
 
Paris Cassandra Meetup - Overview of New Cassandra Drivers
Paris Cassandra Meetup - Overview of New Cassandra DriversParis Cassandra Meetup - Overview of New Cassandra Drivers
Paris Cassandra Meetup - Overview of New Cassandra Drivers
 
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
 
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
 
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...
 

Kürzlich hochgeladen

The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 

Kürzlich hochgeladen (20)

The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 

ApacheCon NA 2013 - The New Face of Apache Cassandra

  • 1. The new face of Cassandra Michaël Figuière @mfiguiere
  • 2. Speaker Michaël Figuière @mfiguiere ©2012 DataStax 2
  • 3. Ring Architecture Node Node Node Cassandra Node Node Node ©2012 DataStax 3
  • 4. Ring Architecture Node Replica Node Replica Node Replica ©2012 DataStax 4
  • 5. Linear Scalability Client Writes/s by Node Count - Replication Factor = 3 ©2012 DataStax 5
  • 6. Client / Server Communication Client ? Node Replica Client Node Replica Client Node Client Replica ©2012 DataStax 6
  • 7. Client / Server Communication Client Node Replica Client Node Replica Client Node Client Replica Coordinator node: Forwards all R/W requests to corresponding replicas ©2012 DataStax 7
  • 8. Tunable Consistency Time A A A 3 replicas ©2012 DataStax 8
  • 9. Tunable Consistency Time A A A B A A Write ‘B’ Write and wait for acknowledge from one node ©2012 DataStax 9
  • 10. Tunable Consistency Time R +W < N A A A B A A B A A Read waiting for one node Write and wait for to answer acknowledge from one node ©2012 DataStax 10
  • 11. Tunable Consistency Time R +W = N A A A B B A B B A Read waiting for one node Write and wait for to answer acknowledges from two nodes ©2012 DataStax 11
  • 12. Tunable Consistency Time R +W > N A A A B B A B B A Read waiting for two nodes Write and wait for to answer acknowledges from two nodes ©2012 DataStax 12
  • 13. Tunable Consistency Time R = W = QUORUM A A A B B A B B A QUORUM = (N / 2) + 1 ©2012 DataStax 13
  • 14. Request Path 1 Client Node Replica 2 3 Client 4 2 Node Replica 3 Client 2 3 Node Client Replica Coordinator node ©2012 DataStax 14
  • 15. Multi-Datacenter Datacenter A Node 1 Node Node Node 2 1 2 Datacenter B Node 3 Node 6 Node 3 Node 4 Datacenter C Node Node 5 Node 5 4 Node 6 ©2012 DataStax 15
  • 16. Column Family Data Model address email name state jbellis 123 main jb@ds.com Jonathan TX address email name state dhutch 45 2nd st dh@ds.com Daria CA email name egilmore eg@ds.com Eric Row Key Columns = List of K/V pairs sorted by Key ©2012 DataStax 16
  • 17. Column Family Data Model datastax dhutch egilmore mzcassie jbellis egilmore dhutch datastax mzcassie egilmore Row Key Columns = List of K/V pairs sorted by Key ©2012 DataStax 17
  • 18. Storage Engine Memtable Memtable Commit SSTable Log SSTable SSTable SSTable ©2012 DataStax 18
  • 19. 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 19
  • 20. 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 20
  • 21. 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 21
  • 22. 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 22
  • 23. 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 23
  • 24. 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 24
  • 25. 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 25
  • 26. Connect and Write Cluster cluster = new 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 26
  • 27. Read ResultSet rs = session.execute("SELECT * FROM test"); List<Row> rows = rs.fetchAll(); for (Row row : rows) { String userId = row.getString("user_id"); String name = row.getString("name"); String email = row.getString("email"); } ©2012 DataStax 27
  • 28. Asynchronous Read ResultSet.Future 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 28
  • 29. 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 29
  • 30. 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 30
  • 31. Now Available! https://github.com/datastax/java-driver
  • 32. Stay Tuned! blog.datastax.com @mfiguiere