SlideShare a Scribd company logo
Python & Cassandra, Best Friends 
Jon Haddad 
Technical Evangelist,Datastax 
@rustyrazorblade 
©2013 DataStax Confidential. Do not distribute without consent. 
1
Virtual Environments 
• Isolated environment per project 
• Build into Python 3.4, available 
• 3rd party lib in Python 2.7 
• pip install virtualenvwrapper 
• Add to your shell startup file: 
• source /usr/local/bin/virtualenvwrapper.sh
Before we start 
• If you'd like to follow along locally, please: 
• have cassandra running 
• clone git@github.com:rustyrazorblade/python-presentation.git 
• create a virtualenv 
• mkvirtualenv tutorial 
• install requirements 
• pip install -r requirements.txt 
• Start the notebook 
• ipython notebook
Why Python? 
• Python is easy to read & write 
• Python is mature 
• It takes less time to develop an app in Python 
• Lots of existing libraries 
• Principle of least astonishment 
•You can be out the door and iterating while the other dev is still working 
• In most applications, most time is spent waiting on the database 
•Dev time is usually more costly than the extra server 
•Correct data model will save you more time than faster app code 
•Focus on architecture
Native Driver Overview 
• Provides means of connecting to a cluster and executing CQL3 queries 
• cassandra.cluster.Cluster keeps track of servers & schema 
• cassandra.cluster.Session manages connection pool 
• Cluster.metadata has keyspace, table information 
• Provides concurrency through cassandra.concurrency 
• session.execute()
cqlengine overview 
• Community project (but moving to DataStax) 
• Created by me & Blake Eggleston (also now at DataStax) 
• Object mapper on top of the native driver 
• Removes the need to write most CQL queries manually 
• Define models, work with regular python types
NO MORE SLIDES!
©2013 DataStax Confidential. Do not distribute without consent. 8

More Related Content

What's hot (19)

PDF
Cassandra Core Concepts - Cassandra Day Toronto
Jon Haddad
 
PPTX
Cassandra @ Sony: The good, the bad, and the ugly part 2
DataStax Academy
 
PDF
Cassandra Summit 2014: Diagnosing Problems in Production
DataStax Academy
 
PDF
Virtualization at Gilt - Rangarajan Radhakrishnan
Datadog
 
PDF
AWS to Bare Metal: Motivation, Pitfalls, and Results
MongoDB
 
PDF
Cassandra Core Concepts
Jon Haddad
 
PDF
20140708 - Jeremy Edberg: How Netflix Delivers Software
DevOps Chicago
 
PPTX
Lessons from the Trenches - Building Enterprise Applications with RavenDB
Oren Eini
 
PDF
Saltstack - Orchestration & Application Deployment
inovex GmbH
 
PDF
High Performance Systems in Go - GopherCon 2014
Derek Collison
 
PDF
Crash course intro to cassandra
Jon Haddad
 
PPTX
Mario Cartia - SMACK is the new LAMP! - Codemotion Milan 2017
Codemotion
 
PDF
Building Codealike: a journey into the developers analytics world
Oren Eini
 
PDF
Monitoring kubernetes across data center and cloud
Datadog
 
PDF
Netflix Open Source Meetup Season 3 Episode 2
aspyker
 
PDF
QCon NYC: Distributed systems in practice, in theory
Aysylu Greenberg
 
PPTX
RavenDB 3.5
Oren Eini
 
PPTX
You're monitoring Kubernetes Wrong
Sysdig
 
PDF
Vagrant for Effective DevOps Culture
Vaidik Kapoor
 
Cassandra Core Concepts - Cassandra Day Toronto
Jon Haddad
 
Cassandra @ Sony: The good, the bad, and the ugly part 2
DataStax Academy
 
Cassandra Summit 2014: Diagnosing Problems in Production
DataStax Academy
 
Virtualization at Gilt - Rangarajan Radhakrishnan
Datadog
 
AWS to Bare Metal: Motivation, Pitfalls, and Results
MongoDB
 
Cassandra Core Concepts
Jon Haddad
 
20140708 - Jeremy Edberg: How Netflix Delivers Software
DevOps Chicago
 
Lessons from the Trenches - Building Enterprise Applications with RavenDB
Oren Eini
 
Saltstack - Orchestration & Application Deployment
inovex GmbH
 
High Performance Systems in Go - GopherCon 2014
Derek Collison
 
Crash course intro to cassandra
Jon Haddad
 
Mario Cartia - SMACK is the new LAMP! - Codemotion Milan 2017
Codemotion
 
Building Codealike: a journey into the developers analytics world
Oren Eini
 
Monitoring kubernetes across data center and cloud
Datadog
 
Netflix Open Source Meetup Season 3 Episode 2
aspyker
 
QCon NYC: Distributed systems in practice, in theory
Aysylu Greenberg
 
RavenDB 3.5
Oren Eini
 
You're monitoring Kubernetes Wrong
Sysdig
 
Vagrant for Effective DevOps Culture
Vaidik Kapoor
 

Viewers also liked (20)

PDF
Intro to py spark (and cassandra)
Jon Haddad
 
PDF
Introduction to Cassandra - Denver
Jon Haddad
 
PDF
Intro to Cassandra
Jon Haddad
 
PDF
Cassandra 3.0 Awesomeness
Jon Haddad
 
PDF
Enter the Snake Pit for Fast and Easy Spark
Jon Haddad
 
PDF
Spark and cassandra (Hulu Talk)
Jon Haddad
 
PDF
Cassandra meetup slides - Oct 15 Santa Monica Coloft
Jon Haddad
 
PDF
PySpark Cassandra - Amsterdam Spark Meetup
Frens Jan Rumph
 
PDF
Python and cassandra
Jon Haddad
 
PDF
Cassandra and Spark
datastaxjp
 
PDF
DataStax: How to Roll Cassandra into Production Without Losing your Health, M...
DataStax Academy
 
PDF
Battery Ventures: Simulating and Visualizing Large Scale Cassandra Deployments
DataStax Academy
 
PDF
DataStax: Old Dogs, New Tricks. Teaching your Relational DBA to fetch
DataStax Academy
 
PDF
DataStax: 7 Deadly Sins for Cassandra Ops
DataStax Academy
 
PDF
DataStax & O'Reilly Media: Large Scale Data Analytics with Spark and Cassandr...
DataStax Academy
 
PDF
Instaclustr: Securing Cassandra
DataStax Academy
 
PDF
DataStax: Making Cassandra Fail (for effective testing)
DataStax Academy
 
PDF
DataStax: Enabling Search in your Cassandra Application with DataStax Enterprise
DataStax Academy
 
PDF
Azure + DataStax Enterprise Powers Office 365 Per User Store
DataStax Academy
 
PDF
Cake Solutions: Cassandra as event sourced journal for big data analytics
DataStax Academy
 
Intro to py spark (and cassandra)
Jon Haddad
 
Introduction to Cassandra - Denver
Jon Haddad
 
Intro to Cassandra
Jon Haddad
 
Cassandra 3.0 Awesomeness
Jon Haddad
 
Enter the Snake Pit for Fast and Easy Spark
Jon Haddad
 
Spark and cassandra (Hulu Talk)
Jon Haddad
 
Cassandra meetup slides - Oct 15 Santa Monica Coloft
Jon Haddad
 
PySpark Cassandra - Amsterdam Spark Meetup
Frens Jan Rumph
 
Python and cassandra
Jon Haddad
 
Cassandra and Spark
datastaxjp
 
DataStax: How to Roll Cassandra into Production Without Losing your Health, M...
DataStax Academy
 
Battery Ventures: Simulating and Visualizing Large Scale Cassandra Deployments
DataStax Academy
 
DataStax: Old Dogs, New Tricks. Teaching your Relational DBA to fetch
DataStax Academy
 
DataStax: 7 Deadly Sins for Cassandra Ops
DataStax Academy
 
DataStax & O'Reilly Media: Large Scale Data Analytics with Spark and Cassandr...
DataStax Academy
 
Instaclustr: Securing Cassandra
DataStax Academy
 
DataStax: Making Cassandra Fail (for effective testing)
DataStax Academy
 
DataStax: Enabling Search in your Cassandra Application with DataStax Enterprise
DataStax Academy
 
Azure + DataStax Enterprise Powers Office 365 Per User Store
DataStax Academy
 
Cake Solutions: Cassandra as event sourced journal for big data analytics
DataStax Academy
 
Ad

Similar to Python & Cassandra - Best Friends (20)

PDF
Cassandra 2.0 to 2.1
Johnny Miller
 
PDF
Cassandra Day Atlanta 2015: Python & Cassandra
DataStax Academy
 
PPTX
DataStax NYC Java Meetup: Cassandra with Java
carolinedatastax
 
PDF
Paris Cassandra Meetup - Cassandra for Developers
Michaël Figuière
 
PDF
Introduction to Apache Cassandra
Robert Stupp
 
ODP
Cassandra drivers
Tyler Hobbs
 
PDF
Going native with Apache Cassandra
Johnny Miller
 
PPTX
An Overview of Apache Cassandra
DataStax
 
PDF
DataStax GeekNet Webinar - Apache Cassandra: Enterprise NoSQL
DataStax
 
PDF
Clojure at DataStax: The Long Road From Python to Clojure
nickmbailey
 
PDF
Sa introduction to big data pipelining with cassandra & spark west mins...
Simon Ambridge
 
PDF
Slides: Relational to NoSQL Migration
DATAVERSITY
 
PDF
State of Cassandra 2012
jbellis
 
PDF
YaJug - Cassandra for Java Developers
Michaël Figuière
 
PDF
Getting Started with Apache Cassandra by Junior Evangelist Rebecca Mills
DataStax Academy
 
PDF
Massively Scalable NoSQL with Apache Cassandra
jbellis
 
PPT
Toronto jaspersoft meetup
Patrick McFadin
 
PDF
Software Development with Apache Cassandra
zznate
 
PDF
Successful Software Development with Apache Cassandra
DataStax Academy
 
PDF
Pycon 2012 Apache Cassandra
jeremiahdjordan
 
Cassandra 2.0 to 2.1
Johnny Miller
 
Cassandra Day Atlanta 2015: Python & Cassandra
DataStax Academy
 
DataStax NYC Java Meetup: Cassandra with Java
carolinedatastax
 
Paris Cassandra Meetup - Cassandra for Developers
Michaël Figuière
 
Introduction to Apache Cassandra
Robert Stupp
 
Cassandra drivers
Tyler Hobbs
 
Going native with Apache Cassandra
Johnny Miller
 
An Overview of Apache Cassandra
DataStax
 
DataStax GeekNet Webinar - Apache Cassandra: Enterprise NoSQL
DataStax
 
Clojure at DataStax: The Long Road From Python to Clojure
nickmbailey
 
Sa introduction to big data pipelining with cassandra & spark west mins...
Simon Ambridge
 
Slides: Relational to NoSQL Migration
DATAVERSITY
 
State of Cassandra 2012
jbellis
 
YaJug - Cassandra for Java Developers
Michaël Figuière
 
Getting Started with Apache Cassandra by Junior Evangelist Rebecca Mills
DataStax Academy
 
Massively Scalable NoSQL with Apache Cassandra
jbellis
 
Toronto jaspersoft meetup
Patrick McFadin
 
Software Development with Apache Cassandra
zznate
 
Successful Software Development with Apache Cassandra
DataStax Academy
 
Pycon 2012 Apache Cassandra
jeremiahdjordan
 
Ad

Recently uploaded (20)

PDF
Complete Network Protection with Real-Time Security
L4RGINDIA
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PPTX
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
PDF
July Patch Tuesday
Ivanti
 
PDF
Persuasive AI: risks and opportunities in the age of digital debate
Speck&Tech
 
PDF
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
PDF
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PPTX
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
PDF
Wojciech Ciemski for Top Cyber News MAGAZINE. June 2025
Dr. Ludmila Morozova-Buss
 
PDF
Predicting the unpredictable: re-engineering recommendation algorithms for fr...
Speck&Tech
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
Why Orbit Edge Tech is a Top Next JS Development Company in 2025
mahendraalaska08
 
PPTX
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
Complete Network Protection with Real-Time Security
L4RGINDIA
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
July Patch Tuesday
Ivanti
 
Persuasive AI: risks and opportunities in the age of digital debate
Speck&Tech
 
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
Wojciech Ciemski for Top Cyber News MAGAZINE. June 2025
Dr. Ludmila Morozova-Buss
 
Predicting the unpredictable: re-engineering recommendation algorithms for fr...
Speck&Tech
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
Why Orbit Edge Tech is a Top Next JS Development Company in 2025
mahendraalaska08
 
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 

Python & Cassandra - Best Friends

  • 1. Python & Cassandra, Best Friends Jon Haddad Technical Evangelist,Datastax @rustyrazorblade ©2013 DataStax Confidential. Do not distribute without consent. 1
  • 2. Virtual Environments • Isolated environment per project • Build into Python 3.4, available • 3rd party lib in Python 2.7 • pip install virtualenvwrapper • Add to your shell startup file: • source /usr/local/bin/virtualenvwrapper.sh
  • 3. Before we start • If you'd like to follow along locally, please: • have cassandra running • clone [email protected]:rustyrazorblade/python-presentation.git • create a virtualenv • mkvirtualenv tutorial • install requirements • pip install -r requirements.txt • Start the notebook • ipython notebook
  • 4. Why Python? • Python is easy to read & write • Python is mature • It takes less time to develop an app in Python • Lots of existing libraries • Principle of least astonishment •You can be out the door and iterating while the other dev is still working • In most applications, most time is spent waiting on the database •Dev time is usually more costly than the extra server •Correct data model will save you more time than faster app code •Focus on architecture
  • 5. Native Driver Overview • Provides means of connecting to a cluster and executing CQL3 queries • cassandra.cluster.Cluster keeps track of servers & schema • cassandra.cluster.Session manages connection pool • Cluster.metadata has keyspace, table information • Provides concurrency through cassandra.concurrency • session.execute()
  • 6. cqlengine overview • Community project (but moving to DataStax) • Created by me & Blake Eggleston (also now at DataStax) • Object mapper on top of the native driver • Removes the need to write most CQL queries manually • Define models, work with regular python types
  • 8. ©2013 DataStax Confidential. Do not distribute without consent. 8