SlideShare a Scribd company logo
1 of 46
Building Applications With Apache Cassandra
NATE MCCALL
Sr. Software Developer




                                     CONFIDENTIAL   |   1
What We’ll Cover



                       Cassandra Basics


                      Common API Usage


                         Storage Model


                         Ring Overview


                   Web Application Integration



                                                 CONFIDENTIAL   |   2
Getting Started




Requirements
   JDK 1.6 or greater
   Apache Maven 3.0.2 or greater
   Apache Cassandra 1.0.7
     – DataStax community edition:
       http://www.datastax.com/download/community/versions
   IDE such as Eclipse or IntelliJ will be helpful but not necessary
   Several thumb drives available (please share)
   All source on GitHub: https://github.com/zznate/strata-west-2012



                                                                   CONFIDENTIAL   |   3
How We’ll Cover It




Learning by doing
   Looking at and writing code
   Examples are constructed explicitly to show off certain concepts
   Move ahead if it gets slow – just start hacking
   You must be comfortable writing and debugging software




                                                                 CONFIDENTIAL   |   4
Getting Down To It




It does not have to be hard.




                               CONFIDENTIAL   |   5
Getting Down To It




                     CONFIDENTIAL   |   6
Getting Down To It




It does not have to be mysterious.




                                     CONFIDENTIAL   |   7
Getting Down To It




                     CONFIDENTIAL   |   8
Getting Down To It




You can leverage a mature language with stable clients
  against a proven, best of breed solution in use at high-
  traffic production environments right now




                                                      CONFIDENTIAL   |   9
What We’ll Cover



                       Cassandra Basics


                      Common API Usage


                         Storage Model


                         Ring Overview


                   Web Application Integration



                                                 CONFIDENTIAL   |   10
Scale Out. But Really Though.


Best of Breed
   Linear scaling
   Real multi-datacenter support
   “Fix it on Monday” fault tolerance




                                         CONFIDENTIAL   |   11
Static Column Family


GOOG          Price:589.55   Name=Google


APPL          Price=401.76    Name=Apple


NFLX           Price=78.73     Nam=Netflix


NOK           Price=6.90     Name=Nokia      Exchange=NYSE




   Schema Optional Not all columns are required
                                                             CONFIDENTIAL   |   12
Dynamic Column Family


  GOOG       10/25/11=583.16    10/24/11=596.42     10/23/11=590.49


  APPL     10/25/11=397.77     10/24/11=405.77     10/23/11=392.87

  NFLX        10/25/11=77.37     10/24/11=118.14     10/23/11=117.23


  NOK          10/25/11=6.71       10/24/11=6.76       10/23/11=6.61




  Prematerialized Queries Store it how you read it
                                                                       CONFIDENTIAL   |   13
The API



              Cassandra Basics


             Common API Usage


                Storage Model


                Ring Overview


          Web Application Integration



                                        CONFIDENTIAL   |   14
Common API Usage




Starting up
   If you didn’t look before hand:
    http://www.datastax.com/docs/1.0/getting_started/index


We want to run the Cassandra process in the foreground to see what’s
going on:
cd $CASSANDRA_HOME
/bin/cassandra -f




                                                              CONFIDENTIAL   |   15
Common API Usage




DataStax OpsCenter
If you are not sure why you should have monitoring, have this running at
all times.
http://www.datastax.com/docs/opscenter/index




                                                                CONFIDENTIAL   |   16
Common API Usage


Static Column Families
   See org.apache.tutorial.BasicUsageExample




                                                CONFIDENTIAL   |   17
Common API Usage


Dynamic Column Families
   See org.apache.tutorial.TimeseriesInserter
    – A Cassandra row can hold up to 2 billion columns




                                                         CONFIDENTIAL   |   18
Common API Usage

Dynamic Column Families
   See org.apache.tutorial.TimeseriesIterationQuery
    – Encapsulate paging in iteration for easier traversal of wide rows




                                                                          CONFIDENTIAL   |   19
Common API Usage




Using CQL
   See comments in class files as we go
    – Use cqlsh for queries, some administration tasks
    – Caveat: no composites or super column support




                                                         CONFIDENTIAL   |   20
Common API Usage




JdbcTemplate
   Some compiling required
     – Not quite there on the typing support
     – Pooling library needs work
     – Give this a try if you want: https://github.com/riptano/jdbc-conn-pool
   Specifically:
     – https://github.com/riptano/jdbc-conn-pool/tree/master/portfolio-example




                                                                         CONFIDENTIAL   |   21
Common API Usage




JdbcTemplate Configuration via ResourceRef




                                             CONFIDENTIAL   |   22
Common API Usage




JdbcTemplate Configuration via Context




                                         CONFIDENTIAL   |   23
Common API Usage




JdbcTemplate Insertion




                         CONFIDENTIAL   |   24
Common API Usage



JdbcTemplate Selection




                         CONFIDENTIAL   |   25
Storage and On-Disk Structure



                        Cassandra Basics


                       Common API Usage


                         Storage Model


                         Ring Overview


                   Web Application Integration



                                                 CONFIDENTIAL   |   26
Merge-On-Read


                Benefits
                On-disk structure is immutable


                   No read-before-write
                   Highest timestamp wins
                   Delete markers (“tombstones”)
                    thrown out on merge




                                             CONFIDENTIAL   |   27
Compaction


             Benefits
             Merge SSTables


                Keeps SSTable count down
                Makes merge-on-read process
                 more efficient
                Groups rows into single SSTable
                Can be vary on workload
                     Size-Tiered compaction
                     Leveled compaction




                                        CONFIDENTIAL   |   28
Common API Usage


Indexing Techniques
   See org.apache.tutorial.CompositeDataLoader
    – Store a static index in a single row




                                                  CONFIDENTIAL   |   29
Common API Usage


Indexing Techniques
   See org.apache.tutorial.CompositeQuery
    – Use slice of composites to narrow in on query




                                                      CONFIDENTIAL   |   30
Common API Usage

Indexing Techniques
   See org.apache.tutorial.CompositeQuery
    – Let’s add another level to the composite




                                                 CONFIDENTIAL   |   31
Common API Usage

Indexing Techniques
   See org.apache.tutorial.CompositeQuery
    – Add a third level to composite to narrow search to “cities in California
      starting with “Ag”




                                                                         CONFIDENTIAL   |   32
Common API Usage




Revisiting the Time Series Example
   See org.apache.tutorial.BucketingTimeSeriesInserter
    – Uses buckets for granularity


Every minute gets a distinct row 2012_02_28_13_30




                                                          CONFIDENTIAL   |   33
Storage Model




Revisiting the Time Series Example
   See org.apache.tutorial.BucketingTimeSeriesQuery
    – More advanced slicing examples
    – Keys can be rebuilt for any time window
    – Keep rows grouped tightly on disk


I need the 30 minutes between 3 and 4pm for every day last week




                                                             CONFIDENTIAL   |   34
Storage Model


Tombstones
   See org.apache.tutorial.TombstoneDemoInserter and
    TombstoneDemoQuery




                                                        CONFIDENTIAL   |   35
Tombstone


Output before deletion




                         CONFIDENTIAL   |   36
Tombstone


Output after deletion




                        CONFIDENTIAL   |   37
Understanding the Ring and Consistency



                       Cassandra Basics


                      Common API Usage


                         Storage Model


                         Ring Overview


                   Web Application Integration



                                                 CONFIDENTIAL   |   38
The Ring


    Token Distribution                 Distributed Hashing
                                       Lexigraphically similar tokens are
                                       hashed to (very) different values
 key          'fon'      'foo'
                                          Provides for shared knowledge of
                                           key location
token 0                          100      The actual token range is from 0
                                           to 2^128
                                          The token is created by converting
                                           an MD5 hash of the key to a
                                           java.lang.BigInteger




                                                                   CONFIDENTIAL   |   39
The Ring


Token Distribution as a Ring       Wrapping Ranges
                                   The next token after the highest
              100   1              possible value is the lowest possible
                                   value.
'foo'                      'fon'




                                                               CONFIDENTIAL   |   40
The Ring


     4 Node Token Distribution         Simplified Ring Example
                                       Nodes distribute ownership via
               Node 1                  Token ranges
               token: 0
                                          A node owns it’s token and the
 “foo”
                                           range immediately before
                                          Nodes continuously “gossip” ring
                                           ownership
  Node 4                   Node 2
token: 75                  token: 25      Any node can act as a coordinator
                                           to service requests for any other
                                           node



                Node 3
               token: 50



                                                                  CONFIDENTIAL   |   41
The Ring


                    Initial Token   First Token       Last Token

    Node 1                      0            76                    0


    Node 2                     25                 1           25


    Node 3                     50            26               50


    Node 4                     75            51               75




    Inclusive token ranges for a four node cluster
                                                                       CONFIDENTIAL   |   42
Integrating with Web Applicaitons



                        Cassandra Basics


                       Common API Usage


                          Storage Model


                          Ring Overview


                    Web Application Integration



                                                  CONFIDENTIAL   |   43
Web Application Integration




Using Spring
   AccountController and AccountDao
    – Similar to JDBC example for wiring




                                           CONFIDENTIAL   |   44
Web Application Integration

Probably as far as we’ll get…
DataStax Documentation: http://www.datastax.com/docs/1.0/index
Apache Cassandra project wiki: http://wiki.apache.org/cassandra/
“The Dynamo Paper”: http://www.allthingsdistributed.com/files/amazon-
dynamo-sosp2007.pdf
P. Helland. Building on Quicksand: http://arxiv.org/pdf/0909.1788
P. Helland. Life Beyond Distributed Transactions:
http://www.ics.uci.edu/~cs223/papers/cidr07p15.pdf
“The Megastore Paper”:
http://research.google.com/pubs/archive/36971.pdf
The Hector Client: http://hector-client.org



                                                                CONFIDENTIAL   |   45
Web Application Integration

Developer Resources
CQL Documentation: http://www.datastax.com/docs/1.0/dml/using_cql
Hector Documentation: http://hector-client.org
Cassandra Maven Plugin: http://mojo.codehaus.org/cassandra-maven-
plugin/
CCM localhost cassandra cluster: https://github.com/pcmanus/ccm
OpsCenter: http://www.datastax.com/products/opscenter
Cassandra AMIs: https://github.com/riptano/CassandraClusterAMI
Cassandra Launcher:
https://github.com/joaquincasares/cassandralauncher




                                                            CONFIDENTIAL   |   46

More Related Content

What's hot

Container security within Cisco Container Platform
Container security within Cisco Container PlatformContainer security within Cisco Container Platform
Container security within Cisco Container PlatformSanjeev Rampal
 
DevJam 2019 - OpenNMS Integration API
DevJam 2019 - OpenNMS Integration APIDevJam 2019 - OpenNMS Integration API
DevJam 2019 - OpenNMS Integration APIRonny Trommer
 
NYC Docker Meetup: Contiv networking on Docker
NYC Docker Meetup: Contiv networking on DockerNYC Docker Meetup: Contiv networking on Docker
NYC Docker Meetup: Contiv networking on DockerSanjeev Rampal
 
Openstack Summit Container Day Keynote
Openstack Summit Container Day KeynoteOpenstack Summit Container Day Keynote
Openstack Summit Container Day KeynoteBoyd Hemphill
 
An Architectural Deep Dive With Kubernetes And Containers Powerpoint Presenta...
An Architectural Deep Dive With Kubernetes And Containers Powerpoint Presenta...An Architectural Deep Dive With Kubernetes And Containers Powerpoint Presenta...
An Architectural Deep Dive With Kubernetes And Containers Powerpoint Presenta...SlideTeam
 
Kubernetes and Cloud Native Update Q4 2018
Kubernetes and Cloud Native Update Q4 2018Kubernetes and Cloud Native Update Q4 2018
Kubernetes and Cloud Native Update Q4 2018CloudOps2005
 
Intel & QLogic NIC performance test results v0.2
Intel & QLogic NIC performance test results v0.2Intel & QLogic NIC performance test results v0.2
Intel & QLogic NIC performance test results v0.2David Pasek
 
Fabio Ferrari | particles.io | Presentation
Fabio Ferrari | particles.io | PresentationFabio Ferrari | particles.io | Presentation
Fabio Ferrari | particles.io | PresentationFabio Ferrari
 
Aspecio - aspect-oriented programming meets the OSGi service model - Simon Ch...
Aspecio - aspect-oriented programming meets the OSGi service model - Simon Ch...Aspecio - aspect-oriented programming meets the OSGi service model - Simon Ch...
Aspecio - aspect-oriented programming meets the OSGi service model - Simon Ch...mfrancis
 
Cloud Application Blueprints with Apache Brooklyn by Alex Henevald
Cloud Application Blueprints with Apache Brooklyn by Alex HenevaldCloud Application Blueprints with Apache Brooklyn by Alex Henevald
Cloud Application Blueprints with Apache Brooklyn by Alex Henevaldbuildacloud
 
The Good, the Bad and the Ugly of Migrating Hundreds of Legacy Applications ...
 The Good, the Bad and the Ugly of Migrating Hundreds of Legacy Applications ... The Good, the Bad and the Ugly of Migrating Hundreds of Legacy Applications ...
The Good, the Bad and the Ugly of Migrating Hundreds of Legacy Applications ...Josef Adersberger
 
Networking For Nested Containers: Magnum, Kuryr, Neutron Integration
Networking For Nested Containers: Magnum, Kuryr, Neutron IntegrationNetworking For Nested Containers: Magnum, Kuryr, Neutron Integration
Networking For Nested Containers: Magnum, Kuryr, Neutron IntegrationFawad Khaliq
 
AWS Summit Singapore 2019 | Autoscaling Your Kubernetes Workloads
AWS Summit Singapore 2019 | Autoscaling Your Kubernetes WorkloadsAWS Summit Singapore 2019 | Autoscaling Your Kubernetes Workloads
AWS Summit Singapore 2019 | Autoscaling Your Kubernetes WorkloadsAWS Summits
 
Kubernetes Concepts And Architecture Powerpoint Presentation Slides
Kubernetes Concepts And Architecture Powerpoint Presentation SlidesKubernetes Concepts And Architecture Powerpoint Presentation Slides
Kubernetes Concepts And Architecture Powerpoint Presentation SlidesSlideTeam
 
Service mesh from linkerd to conduit (cloud native taiwan meetup)
Service mesh from linkerd to conduit (cloud native taiwan meetup)Service mesh from linkerd to conduit (cloud native taiwan meetup)
Service mesh from linkerd to conduit (cloud native taiwan meetup)Chia-Chun Shih
 
Securing and Automating Kubernetes with Kyverno
Securing and Automating Kubernetes with KyvernoSecuring and Automating Kubernetes with Kyverno
Securing and Automating Kubernetes with KyvernoSaim Safder
 
Java is Container Ready - Vaibhav - Container Conference 2018
Java is Container Ready - Vaibhav - Container Conference 2018Java is Container Ready - Vaibhav - Container Conference 2018
Java is Container Ready - Vaibhav - Container Conference 2018CodeOps Technologies LLP
 
AWS Summit Singapore 2019 | Latest Trends for Cloud-Native Application Develo...
AWS Summit Singapore 2019 | Latest Trends for Cloud-Native Application Develo...AWS Summit Singapore 2019 | Latest Trends for Cloud-Native Application Develo...
AWS Summit Singapore 2019 | Latest Trends for Cloud-Native Application Develo...AWS Summits
 
Power of Choice in Docker EE 2.0 - Anoop - Docker - CC18
Power of Choice in Docker EE 2.0 - Anoop - Docker - CC18Power of Choice in Docker EE 2.0 - Anoop - Docker - CC18
Power of Choice in Docker EE 2.0 - Anoop - Docker - CC18CodeOps Technologies LLP
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetesGabriel Carro
 

What's hot (20)

Container security within Cisco Container Platform
Container security within Cisco Container PlatformContainer security within Cisco Container Platform
Container security within Cisco Container Platform
 
DevJam 2019 - OpenNMS Integration API
DevJam 2019 - OpenNMS Integration APIDevJam 2019 - OpenNMS Integration API
DevJam 2019 - OpenNMS Integration API
 
NYC Docker Meetup: Contiv networking on Docker
NYC Docker Meetup: Contiv networking on DockerNYC Docker Meetup: Contiv networking on Docker
NYC Docker Meetup: Contiv networking on Docker
 
Openstack Summit Container Day Keynote
Openstack Summit Container Day KeynoteOpenstack Summit Container Day Keynote
Openstack Summit Container Day Keynote
 
An Architectural Deep Dive With Kubernetes And Containers Powerpoint Presenta...
An Architectural Deep Dive With Kubernetes And Containers Powerpoint Presenta...An Architectural Deep Dive With Kubernetes And Containers Powerpoint Presenta...
An Architectural Deep Dive With Kubernetes And Containers Powerpoint Presenta...
 
Kubernetes and Cloud Native Update Q4 2018
Kubernetes and Cloud Native Update Q4 2018Kubernetes and Cloud Native Update Q4 2018
Kubernetes and Cloud Native Update Q4 2018
 
Intel & QLogic NIC performance test results v0.2
Intel & QLogic NIC performance test results v0.2Intel & QLogic NIC performance test results v0.2
Intel & QLogic NIC performance test results v0.2
 
Fabio Ferrari | particles.io | Presentation
Fabio Ferrari | particles.io | PresentationFabio Ferrari | particles.io | Presentation
Fabio Ferrari | particles.io | Presentation
 
Aspecio - aspect-oriented programming meets the OSGi service model - Simon Ch...
Aspecio - aspect-oriented programming meets the OSGi service model - Simon Ch...Aspecio - aspect-oriented programming meets the OSGi service model - Simon Ch...
Aspecio - aspect-oriented programming meets the OSGi service model - Simon Ch...
 
Cloud Application Blueprints with Apache Brooklyn by Alex Henevald
Cloud Application Blueprints with Apache Brooklyn by Alex HenevaldCloud Application Blueprints with Apache Brooklyn by Alex Henevald
Cloud Application Blueprints with Apache Brooklyn by Alex Henevald
 
The Good, the Bad and the Ugly of Migrating Hundreds of Legacy Applications ...
 The Good, the Bad and the Ugly of Migrating Hundreds of Legacy Applications ... The Good, the Bad and the Ugly of Migrating Hundreds of Legacy Applications ...
The Good, the Bad and the Ugly of Migrating Hundreds of Legacy Applications ...
 
Networking For Nested Containers: Magnum, Kuryr, Neutron Integration
Networking For Nested Containers: Magnum, Kuryr, Neutron IntegrationNetworking For Nested Containers: Magnum, Kuryr, Neutron Integration
Networking For Nested Containers: Magnum, Kuryr, Neutron Integration
 
AWS Summit Singapore 2019 | Autoscaling Your Kubernetes Workloads
AWS Summit Singapore 2019 | Autoscaling Your Kubernetes WorkloadsAWS Summit Singapore 2019 | Autoscaling Your Kubernetes Workloads
AWS Summit Singapore 2019 | Autoscaling Your Kubernetes Workloads
 
Kubernetes Concepts And Architecture Powerpoint Presentation Slides
Kubernetes Concepts And Architecture Powerpoint Presentation SlidesKubernetes Concepts And Architecture Powerpoint Presentation Slides
Kubernetes Concepts And Architecture Powerpoint Presentation Slides
 
Service mesh from linkerd to conduit (cloud native taiwan meetup)
Service mesh from linkerd to conduit (cloud native taiwan meetup)Service mesh from linkerd to conduit (cloud native taiwan meetup)
Service mesh from linkerd to conduit (cloud native taiwan meetup)
 
Securing and Automating Kubernetes with Kyverno
Securing and Automating Kubernetes with KyvernoSecuring and Automating Kubernetes with Kyverno
Securing and Automating Kubernetes with Kyverno
 
Java is Container Ready - Vaibhav - Container Conference 2018
Java is Container Ready - Vaibhav - Container Conference 2018Java is Container Ready - Vaibhav - Container Conference 2018
Java is Container Ready - Vaibhav - Container Conference 2018
 
AWS Summit Singapore 2019 | Latest Trends for Cloud-Native Application Develo...
AWS Summit Singapore 2019 | Latest Trends for Cloud-Native Application Develo...AWS Summit Singapore 2019 | Latest Trends for Cloud-Native Application Develo...
AWS Summit Singapore 2019 | Latest Trends for Cloud-Native Application Develo...
 
Power of Choice in Docker EE 2.0 - Anoop - Docker - CC18
Power of Choice in Docker EE 2.0 - Anoop - Docker - CC18Power of Choice in Docker EE 2.0 - Anoop - Docker - CC18
Power of Choice in Docker EE 2.0 - Anoop - Docker - CC18
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetes
 

Viewers also liked

Intravert atx meetup_condensed
Intravert atx meetup_condensedIntravert atx meetup_condensed
Intravert atx meetup_condensedzznate
 
Oscon 2012 tdd_cassandra
Oscon 2012 tdd_cassandraOscon 2012 tdd_cassandra
Oscon 2012 tdd_cassandrazznate
 
Successful Software Development with Apache Cassandra
Successful Software Development with Apache CassandraSuccessful Software Development with Apache Cassandra
Successful Software Development with Apache Cassandrazznate
 
Apachecon cassandra transport
Apachecon cassandra transportApachecon cassandra transport
Apachecon cassandra transportzznate
 
Ben Coverston - The Apache Cassandra Project
Ben Coverston - The Apache Cassandra ProjectBen Coverston - The Apache Cassandra Project
Ben Coverston - The Apache Cassandra ProjectMorningstar Tech Talks
 
Let's talk about NoSQL Standard
Let's talk about NoSQL StandardLet's talk about NoSQL Standard
Let's talk about NoSQL StandardOtávio Santana
 
Introduciton to Apache Cassandra for Java Developers (JavaOne)
Introduciton to Apache Cassandra for Java Developers (JavaOne)Introduciton to Apache Cassandra for Java Developers (JavaOne)
Introduciton to Apache Cassandra for Java Developers (JavaOne)zznate
 
Hello DataStax Enterprise Graph
Hello DataStax Enterprise Graph Hello DataStax Enterprise Graph
Hello DataStax Enterprise Graph DataStax
 

Viewers also liked (8)

Intravert atx meetup_condensed
Intravert atx meetup_condensedIntravert atx meetup_condensed
Intravert atx meetup_condensed
 
Oscon 2012 tdd_cassandra
Oscon 2012 tdd_cassandraOscon 2012 tdd_cassandra
Oscon 2012 tdd_cassandra
 
Successful Software Development with Apache Cassandra
Successful Software Development with Apache CassandraSuccessful Software Development with Apache Cassandra
Successful Software Development with Apache Cassandra
 
Apachecon cassandra transport
Apachecon cassandra transportApachecon cassandra transport
Apachecon cassandra transport
 
Ben Coverston - The Apache Cassandra Project
Ben Coverston - The Apache Cassandra ProjectBen Coverston - The Apache Cassandra Project
Ben Coverston - The Apache Cassandra Project
 
Let's talk about NoSQL Standard
Let's talk about NoSQL StandardLet's talk about NoSQL Standard
Let's talk about NoSQL Standard
 
Introduciton to Apache Cassandra for Java Developers (JavaOne)
Introduciton to Apache Cassandra for Java Developers (JavaOne)Introduciton to Apache Cassandra for Java Developers (JavaOne)
Introduciton to Apache Cassandra for Java Developers (JavaOne)
 
Hello DataStax Enterprise Graph
Hello DataStax Enterprise Graph Hello DataStax Enterprise Graph
Hello DataStax Enterprise Graph
 

Similar to Strata west 2012_java_cassandra

Azure development
Azure developmentAzure development
Azure developmentwseye
 
Clean Infrastructure as Code
Clean Infrastructure as CodeClean Infrastructure as Code
Clean Infrastructure as CodeQAware GmbH
 
AngularJS introduction
AngularJS introductionAngularJS introduction
AngularJS introductionTania Gonzales
 
Angular js introduction by Tania Gonzales
Angular js introduction by Tania GonzalesAngular js introduction by Tania Gonzales
Angular js introduction by Tania GonzalesThoughtworks
 
Running and Managing Kubernetes on OpenStack
Running and Managing Kubernetes on OpenStackRunning and Managing Kubernetes on OpenStack
Running and Managing Kubernetes on OpenStackVictor Palma
 
Red Hat OpenShift & CoreOS by Ludovic Aelbrecht, Senior Solution Architect at...
Red Hat OpenShift & CoreOS by Ludovic Aelbrecht, Senior Solution Architect at...Red Hat OpenShift & CoreOS by Ludovic Aelbrecht, Senior Solution Architect at...
Red Hat OpenShift & CoreOS by Ludovic Aelbrecht, Senior Solution Architect at...Kangaroot
 
Getting Started with jClouds: Multi Cloud Framework
Getting Started with jClouds: Multi Cloud FrameworkGetting Started with jClouds: Multi Cloud Framework
Getting Started with jClouds: Multi Cloud FrameworkIndicThreads
 
Kubernetes for the VI Admin
Kubernetes for the VI AdminKubernetes for the VI Admin
Kubernetes for the VI AdminKendrick Coleman
 
Halifax DevOps - Meet-up - July.19 2017
Halifax DevOps - Meet-up - July.19 2017Halifax DevOps - Meet-up - July.19 2017
Halifax DevOps - Meet-up - July.19 2017Kyle Bassett
 
Easy multi-tenant-kubernetes-rwx-storage-with-cloud-provider-openstack-and-ma...
Easy multi-tenant-kubernetes-rwx-storage-with-cloud-provider-openstack-and-ma...Easy multi-tenant-kubernetes-rwx-storage-with-cloud-provider-openstack-and-ma...
Easy multi-tenant-kubernetes-rwx-storage-with-cloud-provider-openstack-and-ma...TomBarron
 
GR8Conf 2011: Grails, how to plug in
GR8Conf 2011: Grails, how to plug inGR8Conf 2011: Grails, how to plug in
GR8Conf 2011: Grails, how to plug inGR8Conf
 
Docker vs. Kubernetes vs. Serverless
Docker vs. Kubernetes vs. ServerlessDocker vs. Kubernetes vs. Serverless
Docker vs. Kubernetes vs. ServerlessLogicworksNY
 
Cloudify 6 Webinar
Cloudify 6 WebinarCloudify 6 Webinar
Cloudify 6 WebinarJonnyRosen2
 
Three Degrees of Mediation: Challenges and Lessons in building Cloud-agnostic...
Three Degrees of Mediation: Challenges and Lessons in building Cloud-agnostic...Three Degrees of Mediation: Challenges and Lessons in building Cloud-agnostic...
Three Degrees of Mediation: Challenges and Lessons in building Cloud-agnostic...Alex Maclinovsky
 
Best practices: running high-performance databases on Kubernetes
Best practices: running high-performance databases on KubernetesBest practices: running high-performance databases on Kubernetes
Best practices: running high-performance databases on KubernetesMariaDB plc
 
One And Done Multi-Cloud Load Balancing Done Right.pptx
One And Done Multi-Cloud Load Balancing Done Right.pptxOne And Done Multi-Cloud Load Balancing Done Right.pptx
One And Done Multi-Cloud Load Balancing Done Right.pptxAvi Networks
 
Kubernetes and Hybrid Deployments
Kubernetes and Hybrid DeploymentsKubernetes and Hybrid Deployments
Kubernetes and Hybrid DeploymentsSandeep Parikh
 
Cloud Native Dünyada CI/CD
Cloud Native Dünyada CI/CDCloud Native Dünyada CI/CD
Cloud Native Dünyada CI/CDMustafa AKIN
 

Similar to Strata west 2012_java_cassandra (20)

Azure development
Azure developmentAzure development
Azure development
 
Clean Infrastructure as Code
Clean Infrastructure as CodeClean Infrastructure as Code
Clean Infrastructure as Code
 
AngularJS introduction
AngularJS introductionAngularJS introduction
AngularJS introduction
 
Angular js introduction by Tania Gonzales
Angular js introduction by Tania GonzalesAngular js introduction by Tania Gonzales
Angular js introduction by Tania Gonzales
 
Running and Managing Kubernetes on OpenStack
Running and Managing Kubernetes on OpenStackRunning and Managing Kubernetes on OpenStack
Running and Managing Kubernetes on OpenStack
 
Red Hat OpenShift & CoreOS by Ludovic Aelbrecht, Senior Solution Architect at...
Red Hat OpenShift & CoreOS by Ludovic Aelbrecht, Senior Solution Architect at...Red Hat OpenShift & CoreOS by Ludovic Aelbrecht, Senior Solution Architect at...
Red Hat OpenShift & CoreOS by Ludovic Aelbrecht, Senior Solution Architect at...
 
Getting Started with jClouds: Multi Cloud Framework
Getting Started with jClouds: Multi Cloud FrameworkGetting Started with jClouds: Multi Cloud Framework
Getting Started with jClouds: Multi Cloud Framework
 
Getting started with jClouds
Getting started with jCloudsGetting started with jClouds
Getting started with jClouds
 
Case Study Telefonica
Case Study TelefonicaCase Study Telefonica
Case Study Telefonica
 
Kubernetes for the VI Admin
Kubernetes for the VI AdminKubernetes for the VI Admin
Kubernetes for the VI Admin
 
Halifax DevOps - Meet-up - July.19 2017
Halifax DevOps - Meet-up - July.19 2017Halifax DevOps - Meet-up - July.19 2017
Halifax DevOps - Meet-up - July.19 2017
 
Easy multi-tenant-kubernetes-rwx-storage-with-cloud-provider-openstack-and-ma...
Easy multi-tenant-kubernetes-rwx-storage-with-cloud-provider-openstack-and-ma...Easy multi-tenant-kubernetes-rwx-storage-with-cloud-provider-openstack-and-ma...
Easy multi-tenant-kubernetes-rwx-storage-with-cloud-provider-openstack-and-ma...
 
GR8Conf 2011: Grails, how to plug in
GR8Conf 2011: Grails, how to plug inGR8Conf 2011: Grails, how to plug in
GR8Conf 2011: Grails, how to plug in
 
Docker vs. Kubernetes vs. Serverless
Docker vs. Kubernetes vs. ServerlessDocker vs. Kubernetes vs. Serverless
Docker vs. Kubernetes vs. Serverless
 
Cloudify 6 Webinar
Cloudify 6 WebinarCloudify 6 Webinar
Cloudify 6 Webinar
 
Three Degrees of Mediation: Challenges and Lessons in building Cloud-agnostic...
Three Degrees of Mediation: Challenges and Lessons in building Cloud-agnostic...Three Degrees of Mediation: Challenges and Lessons in building Cloud-agnostic...
Three Degrees of Mediation: Challenges and Lessons in building Cloud-agnostic...
 
Best practices: running high-performance databases on Kubernetes
Best practices: running high-performance databases on KubernetesBest practices: running high-performance databases on Kubernetes
Best practices: running high-performance databases on Kubernetes
 
One And Done Multi-Cloud Load Balancing Done Right.pptx
One And Done Multi-Cloud Load Balancing Done Right.pptxOne And Done Multi-Cloud Load Balancing Done Right.pptx
One And Done Multi-Cloud Load Balancing Done Right.pptx
 
Kubernetes and Hybrid Deployments
Kubernetes and Hybrid DeploymentsKubernetes and Hybrid Deployments
Kubernetes and Hybrid Deployments
 
Cloud Native Dünyada CI/CD
Cloud Native Dünyada CI/CDCloud Native Dünyada CI/CD
Cloud Native Dünyada CI/CD
 

More from zznate

Advanced Apache Cassandra Operations with JMX
Advanced Apache Cassandra Operations with JMXAdvanced Apache Cassandra Operations with JMX
Advanced Apache Cassandra Operations with JMXzznate
 
Hardening cassandra q2_2016
Hardening cassandra q2_2016Hardening cassandra q2_2016
Hardening cassandra q2_2016zznate
 
Seattle C* Meetup: Hardening cassandra for compliance or paranoia
Seattle C* Meetup: Hardening cassandra for compliance or paranoiaSeattle C* Meetup: Hardening cassandra for compliance or paranoia
Seattle C* Meetup: Hardening cassandra for compliance or paranoiazznate
 
Software Development with Apache Cassandra
Software Development with Apache CassandraSoftware Development with Apache Cassandra
Software Development with Apache Cassandrazznate
 
Hardening cassandra for compliance or paranoia
Hardening cassandra for compliance or paranoiaHardening cassandra for compliance or paranoia
Hardening cassandra for compliance or paranoiazznate
 
Stampede con 2014 cassandra in the real world
Stampede con 2014   cassandra in the real worldStampede con 2014   cassandra in the real world
Stampede con 2014 cassandra in the real worldzznate
 
An Introduction to the Vert.x framework
An Introduction to the Vert.x frameworkAn Introduction to the Vert.x framework
An Introduction to the Vert.x frameworkzznate
 
Nyc summit intro_to_cassandra
Nyc summit intro_to_cassandraNyc summit intro_to_cassandra
Nyc summit intro_to_cassandrazznate
 
Meetup cassandra sfo_jdbc
Meetup cassandra sfo_jdbcMeetup cassandra sfo_jdbc
Meetup cassandra sfo_jdbczznate
 
Meetup cassandra for_java_cql
Meetup cassandra for_java_cqlMeetup cassandra for_java_cql
Meetup cassandra for_java_cqlzznate
 
Introduction to apache_cassandra_for_developers-lhg
Introduction to apache_cassandra_for_developers-lhgIntroduction to apache_cassandra_for_developers-lhg
Introduction to apache_cassandra_for_developers-lhgzznate
 
Introduction to apache_cassandra_for_develope
Introduction to apache_cassandra_for_developeIntroduction to apache_cassandra_for_develope
Introduction to apache_cassandra_for_developezznate
 
Hector v2: The Second Version of the Popular High-Level Java Client for Apach...
Hector v2: The Second Version of the Popular High-Level Java Client for Apach...Hector v2: The Second Version of the Popular High-Level Java Client for Apach...
Hector v2: The Second Version of the Popular High-Level Java Client for Apach...zznate
 

More from zznate (13)

Advanced Apache Cassandra Operations with JMX
Advanced Apache Cassandra Operations with JMXAdvanced Apache Cassandra Operations with JMX
Advanced Apache Cassandra Operations with JMX
 
Hardening cassandra q2_2016
Hardening cassandra q2_2016Hardening cassandra q2_2016
Hardening cassandra q2_2016
 
Seattle C* Meetup: Hardening cassandra for compliance or paranoia
Seattle C* Meetup: Hardening cassandra for compliance or paranoiaSeattle C* Meetup: Hardening cassandra for compliance or paranoia
Seattle C* Meetup: Hardening cassandra for compliance or paranoia
 
Software Development with Apache Cassandra
Software Development with Apache CassandraSoftware Development with Apache Cassandra
Software Development with Apache Cassandra
 
Hardening cassandra for compliance or paranoia
Hardening cassandra for compliance or paranoiaHardening cassandra for compliance or paranoia
Hardening cassandra for compliance or paranoia
 
Stampede con 2014 cassandra in the real world
Stampede con 2014   cassandra in the real worldStampede con 2014   cassandra in the real world
Stampede con 2014 cassandra in the real world
 
An Introduction to the Vert.x framework
An Introduction to the Vert.x frameworkAn Introduction to the Vert.x framework
An Introduction to the Vert.x framework
 
Nyc summit intro_to_cassandra
Nyc summit intro_to_cassandraNyc summit intro_to_cassandra
Nyc summit intro_to_cassandra
 
Meetup cassandra sfo_jdbc
Meetup cassandra sfo_jdbcMeetup cassandra sfo_jdbc
Meetup cassandra sfo_jdbc
 
Meetup cassandra for_java_cql
Meetup cassandra for_java_cqlMeetup cassandra for_java_cql
Meetup cassandra for_java_cql
 
Introduction to apache_cassandra_for_developers-lhg
Introduction to apache_cassandra_for_developers-lhgIntroduction to apache_cassandra_for_developers-lhg
Introduction to apache_cassandra_for_developers-lhg
 
Introduction to apache_cassandra_for_develope
Introduction to apache_cassandra_for_developeIntroduction to apache_cassandra_for_develope
Introduction to apache_cassandra_for_develope
 
Hector v2: The Second Version of the Popular High-Level Java Client for Apach...
Hector v2: The Second Version of the Popular High-Level Java Client for Apach...Hector v2: The Second Version of the Popular High-Level Java Client for Apach...
Hector v2: The Second Version of the Popular High-Level Java Client for Apach...
 

Recently uploaded

What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 

Recently uploaded (20)

What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 

Strata west 2012_java_cassandra

  • 1. Building Applications With Apache Cassandra NATE MCCALL Sr. Software Developer CONFIDENTIAL | 1
  • 2. What We’ll Cover Cassandra Basics Common API Usage Storage Model Ring Overview Web Application Integration CONFIDENTIAL | 2
  • 3. Getting Started Requirements  JDK 1.6 or greater  Apache Maven 3.0.2 or greater  Apache Cassandra 1.0.7 – DataStax community edition: http://www.datastax.com/download/community/versions  IDE such as Eclipse or IntelliJ will be helpful but not necessary  Several thumb drives available (please share)  All source on GitHub: https://github.com/zznate/strata-west-2012 CONFIDENTIAL | 3
  • 4. How We’ll Cover It Learning by doing  Looking at and writing code  Examples are constructed explicitly to show off certain concepts  Move ahead if it gets slow – just start hacking  You must be comfortable writing and debugging software CONFIDENTIAL | 4
  • 5. Getting Down To It It does not have to be hard. CONFIDENTIAL | 5
  • 6. Getting Down To It CONFIDENTIAL | 6
  • 7. Getting Down To It It does not have to be mysterious. CONFIDENTIAL | 7
  • 8. Getting Down To It CONFIDENTIAL | 8
  • 9. Getting Down To It You can leverage a mature language with stable clients against a proven, best of breed solution in use at high- traffic production environments right now CONFIDENTIAL | 9
  • 10. What We’ll Cover Cassandra Basics Common API Usage Storage Model Ring Overview Web Application Integration CONFIDENTIAL | 10
  • 11. Scale Out. But Really Though. Best of Breed  Linear scaling  Real multi-datacenter support  “Fix it on Monday” fault tolerance CONFIDENTIAL | 11
  • 12. Static Column Family GOOG Price:589.55 Name=Google APPL Price=401.76 Name=Apple NFLX Price=78.73 Nam=Netflix NOK Price=6.90 Name=Nokia Exchange=NYSE Schema Optional Not all columns are required CONFIDENTIAL | 12
  • 13. Dynamic Column Family GOOG 10/25/11=583.16 10/24/11=596.42 10/23/11=590.49 APPL 10/25/11=397.77 10/24/11=405.77 10/23/11=392.87 NFLX 10/25/11=77.37 10/24/11=118.14 10/23/11=117.23 NOK 10/25/11=6.71 10/24/11=6.76 10/23/11=6.61 Prematerialized Queries Store it how you read it CONFIDENTIAL | 13
  • 14. The API Cassandra Basics Common API Usage Storage Model Ring Overview Web Application Integration CONFIDENTIAL | 14
  • 15. Common API Usage Starting up  If you didn’t look before hand: http://www.datastax.com/docs/1.0/getting_started/index We want to run the Cassandra process in the foreground to see what’s going on: cd $CASSANDRA_HOME /bin/cassandra -f CONFIDENTIAL | 15
  • 16. Common API Usage DataStax OpsCenter If you are not sure why you should have monitoring, have this running at all times. http://www.datastax.com/docs/opscenter/index CONFIDENTIAL | 16
  • 17. Common API Usage Static Column Families  See org.apache.tutorial.BasicUsageExample CONFIDENTIAL | 17
  • 18. Common API Usage Dynamic Column Families  See org.apache.tutorial.TimeseriesInserter – A Cassandra row can hold up to 2 billion columns CONFIDENTIAL | 18
  • 19. Common API Usage Dynamic Column Families  See org.apache.tutorial.TimeseriesIterationQuery – Encapsulate paging in iteration for easier traversal of wide rows CONFIDENTIAL | 19
  • 20. Common API Usage Using CQL  See comments in class files as we go – Use cqlsh for queries, some administration tasks – Caveat: no composites or super column support CONFIDENTIAL | 20
  • 21. Common API Usage JdbcTemplate  Some compiling required – Not quite there on the typing support – Pooling library needs work – Give this a try if you want: https://github.com/riptano/jdbc-conn-pool  Specifically: – https://github.com/riptano/jdbc-conn-pool/tree/master/portfolio-example CONFIDENTIAL | 21
  • 22. Common API Usage JdbcTemplate Configuration via ResourceRef CONFIDENTIAL | 22
  • 23. Common API Usage JdbcTemplate Configuration via Context CONFIDENTIAL | 23
  • 24. Common API Usage JdbcTemplate Insertion CONFIDENTIAL | 24
  • 25. Common API Usage JdbcTemplate Selection CONFIDENTIAL | 25
  • 26. Storage and On-Disk Structure Cassandra Basics Common API Usage Storage Model Ring Overview Web Application Integration CONFIDENTIAL | 26
  • 27. Merge-On-Read Benefits On-disk structure is immutable  No read-before-write  Highest timestamp wins  Delete markers (“tombstones”) thrown out on merge CONFIDENTIAL | 27
  • 28. Compaction Benefits Merge SSTables  Keeps SSTable count down  Makes merge-on-read process more efficient  Groups rows into single SSTable  Can be vary on workload  Size-Tiered compaction  Leveled compaction CONFIDENTIAL | 28
  • 29. Common API Usage Indexing Techniques  See org.apache.tutorial.CompositeDataLoader – Store a static index in a single row CONFIDENTIAL | 29
  • 30. Common API Usage Indexing Techniques  See org.apache.tutorial.CompositeQuery – Use slice of composites to narrow in on query CONFIDENTIAL | 30
  • 31. Common API Usage Indexing Techniques  See org.apache.tutorial.CompositeQuery – Let’s add another level to the composite CONFIDENTIAL | 31
  • 32. Common API Usage Indexing Techniques  See org.apache.tutorial.CompositeQuery – Add a third level to composite to narrow search to “cities in California starting with “Ag” CONFIDENTIAL | 32
  • 33. Common API Usage Revisiting the Time Series Example  See org.apache.tutorial.BucketingTimeSeriesInserter – Uses buckets for granularity Every minute gets a distinct row 2012_02_28_13_30 CONFIDENTIAL | 33
  • 34. Storage Model Revisiting the Time Series Example  See org.apache.tutorial.BucketingTimeSeriesQuery – More advanced slicing examples – Keys can be rebuilt for any time window – Keep rows grouped tightly on disk I need the 30 minutes between 3 and 4pm for every day last week CONFIDENTIAL | 34
  • 35. Storage Model Tombstones  See org.apache.tutorial.TombstoneDemoInserter and TombstoneDemoQuery CONFIDENTIAL | 35
  • 36. Tombstone Output before deletion CONFIDENTIAL | 36
  • 37. Tombstone Output after deletion CONFIDENTIAL | 37
  • 38. Understanding the Ring and Consistency Cassandra Basics Common API Usage Storage Model Ring Overview Web Application Integration CONFIDENTIAL | 38
  • 39. The Ring Token Distribution Distributed Hashing Lexigraphically similar tokens are hashed to (very) different values key 'fon' 'foo'  Provides for shared knowledge of key location token 0 100  The actual token range is from 0 to 2^128  The token is created by converting an MD5 hash of the key to a java.lang.BigInteger CONFIDENTIAL | 39
  • 40. The Ring Token Distribution as a Ring Wrapping Ranges The next token after the highest 100 1 possible value is the lowest possible value. 'foo' 'fon' CONFIDENTIAL | 40
  • 41. The Ring 4 Node Token Distribution Simplified Ring Example Nodes distribute ownership via Node 1 Token ranges token: 0  A node owns it’s token and the “foo” range immediately before  Nodes continuously “gossip” ring ownership Node 4 Node 2 token: 75 token: 25  Any node can act as a coordinator to service requests for any other node Node 3 token: 50 CONFIDENTIAL | 41
  • 42. The Ring Initial Token First Token Last Token Node 1 0 76 0 Node 2 25 1 25 Node 3 50 26 50 Node 4 75 51 75 Inclusive token ranges for a four node cluster CONFIDENTIAL | 42
  • 43. Integrating with Web Applicaitons Cassandra Basics Common API Usage Storage Model Ring Overview Web Application Integration CONFIDENTIAL | 43
  • 44. Web Application Integration Using Spring  AccountController and AccountDao – Similar to JDBC example for wiring CONFIDENTIAL | 44
  • 45. Web Application Integration Probably as far as we’ll get… DataStax Documentation: http://www.datastax.com/docs/1.0/index Apache Cassandra project wiki: http://wiki.apache.org/cassandra/ “The Dynamo Paper”: http://www.allthingsdistributed.com/files/amazon- dynamo-sosp2007.pdf P. Helland. Building on Quicksand: http://arxiv.org/pdf/0909.1788 P. Helland. Life Beyond Distributed Transactions: http://www.ics.uci.edu/~cs223/papers/cidr07p15.pdf “The Megastore Paper”: http://research.google.com/pubs/archive/36971.pdf The Hector Client: http://hector-client.org CONFIDENTIAL | 45
  • 46. Web Application Integration Developer Resources CQL Documentation: http://www.datastax.com/docs/1.0/dml/using_cql Hector Documentation: http://hector-client.org Cassandra Maven Plugin: http://mojo.codehaus.org/cassandra-maven- plugin/ CCM localhost cassandra cluster: https://github.com/pcmanus/ccm OpsCenter: http://www.datastax.com/products/opscenter Cassandra AMIs: https://github.com/riptano/CassandraClusterAMI Cassandra Launcher: https://github.com/joaquincasares/cassandralauncher CONFIDENTIAL | 46