SlideShare ist ein Scribd-Unternehmen logo
1 von 49
Downloaden Sie, um offline zu lesen
Cassandra: Consistency & Tolerance
(a morality guide for databases)
Matt Kennedy, Architect
@thetweetofmatt
©2014 DataStax Confidential. Do not distribute without consent. 2
©2014 DataStax Confidential. Do not distribute without consent. 3
©2014 DataStax Confidential. Do not distribute without consent. 4
©2014 DataStax Confidential. Do not distribute without consent. 5
©2014 DataStax Confidential. Do not distribute without consent. 6
©2014 DataStax Confidential. Do not distribute without consent. 7
©2014 DataStax Confidential. Do not distribute without consent. 8
©2014 DataStax Confidential. Do not distribute without consent. 9
©2014 DataStax Confidential. Do not distribute without consent. 10
©2014 DataStax Confidential. Do not distribute without consent. 11
©2014 DataStax Confidential. Do not distribute without consent. 12
?
©2014 DataStax Confidential. Do not distribute without consent. 13
Georgetown
American
20 minutes
Worth the wait?
©2014 DataStax Confidential. Do not distribute without consent. 14
Georgetown
American
©2014 DataStax Confidential. Do not distribute without consent. 15
Lessons?
•  High Availability means:
•  Have to maintain some redundancy
•  Need to distribute your stuff
•  Distributed Stuff means:
•  Need to accommodate unreliable networks
•  Need to have strategies for different path costs
•  Plan for outright failures
•  Cooperation!
Also, don’t underestimate a squirrel with a Jesuit education.
©2014 DataStax Confidential. Do not distribute without consent. 16
©2014 DataStax Confidential. Do not distribute without consent. 17
©2014 DataStax Confidential. Do not distribute without consent. 18
Eventual Consistency
Meh.
©2014 DataStax Confidential. Do not distribute without consent. 19
http://nekrocodile-izumi.deviantart.com/art/Lazy-college-student-322186707
©2014 DataStax Confidential. Do not distribute without consent. 20
©2014 DataStax Confidential. Do not distribute without consent. 21
©2014 DataStax Confidential. Do not distribute without consent. 22
Consistency vs. Consistency
©2014 DataStax Confidential. Do not distribute without consent. 23
©2014 DataStax Confidential. Do not distribute without consent. 24
Tunable Consistency & High Availability
©2014 DataStax Confidential. Do not distribute without consent. 25
Example assumes replication factor = 3
write
read
Quorum-write, RF=5
©2014 DataStax Confidential. Do not distribute without consent. 26
Client
6-node cluster, rf=5
OK!
Quorum read RF=5
©2014 DataStax Confidential. Do not distribute without consent. 27
Client
6-node cluster, rf=5
00101010
00101010
0010101000101010
? ?
Read value: 00101010
©2014 DataStax Confidential. Do not distribute without consent. 28
Linearizable Consistency
•  AKA:
•  Compare & Set
•  Check & Set
•  Lightweight Transactions
•  CQL “IF” Statements
•  Uses Paxos
•  Can specify local datacenter or all datacenters
•  (CASSANDRA-5797)
©2014 DataStax Confidential. Do not distribute without consent. 29
Linearizable Consistency
•  Put X in the database if X is not already in the
database
•  Set foo=bar if foo=baz
•  Set foo=bar if boo=faz
©2014 DataStax Confidential. Do not distribute without consent. 30
©2014 DataStax Confidential. Do not distribute without consent. 31
MONSTER MASH!!!
Alice Bob
Create “Stinky”
C*
Create “Stinky”
Insert “Stinky”
Insert “Stinky”Quorum insert
Quorum insert
Now Bob owns “Stinky” and Alice doesn’t know
why she can’t see the monster she just made
©2014 DataStax Confidential. Do not distribute without consent. 32
MONSTER MASH!!!
Alice Bob
Create “Stinky”
C*
Create “Stinky”
Insert “Stinky”
Insert “Stinky”
LWT Insert
LWT insert
NO!
Consistency & Cassandra
• Tunable Consistency
• Linearizable Consistency
• Your App can tell C* what it needs
©2014 DataStax Confidential. Do not distribute without consent. 33
THIS IS IMPORTANT
•  The Consistency Mechanisms are King
•  Cassandra’s core strengths…
•  High Availability
•  Tolerance of node failures
•  Tolerance of datacenter failures
•  Tolerance of network failures between datacenters
•  All due to the Consistency Mechanisms
•  Cassandra isn’t Cassandra without Eventual
Consistency
©2014 DataStax Confidential. Do not distribute without consent. 34
Consistency is a Key Value!
•  Get it? Key-Value?
•  It’s a NoSQL joke.
•  Always-on Big Data demands multi-region DCs
•  Multi-region DCs must face the reality of network partitions
•  Eventual Consistency enables applications built on
Cassandra to do what they need to do correctly and flexibly
while remaining constantly available.
©2014 DataStax Confidential. Do not distribute without consent. 35
Thank You
©2014 DataStax Confidential. Do not distribute without consent.
Tunable Consistency & High Availability
©2014 DataStax Confidential. Do not distribute without consent. 37
write
read
Example assumes replication factor = 3
1.
2.
write
read
3.
Options 1 & 2 achieve strong
consistency at the expense of
availability. Option 3 requires
only 2 replicas on write and 2
on read, so it achieves high
availability & strong
consistency.
Eventual Consistency The Netflix Experiment
•  “Eventual Consistency != Hopeful Consistency”
•  Netflix, big C* user, performed an experiment
©2014 DataStax Confidential. Do not distribute without consent. 38
http://planetcassandra.org/blog/post/a-netflix-experiment-eventual-consistency-hopeful-consistency-by-christos-kalantzis/
©2014 DataStax Confidential. Do not distribute without consent. 39
C* Datacenters A Single Cluster
©2014 DataStax Confidential. Do not distribute without consent. 40
One
Datacenter
Peer-to-peer ring of nodes
Datacenters can go offline…
©2014 DataStax Confidential. Do not distribute without consent. 41
For a variety of reasons
©2014 DataStax Confidential. Do not distribute without consent. 42
C* Datacenters A Single Cluster
©2014 DataStax Confidential. Do not distribute without consent. 43
One
Datacenter
Peer-to-peer ring of nodes
C* Datacenters What happens when I lose one?
Los
Angeles
©2014 DataStax Confidential. Do not distribute without consent. 44
Chicago
New
York
C* Datacenters What is possible?
Los
Angeles
©2014 DataStax Confidential. Do not distribute without consent. 45
Chicago
New
York
Cloud
C* Datacenters Cloud Deployments
©2014 DataStax Confidential. Do not distribute without consent. 46
Availability
Zone 1
AWS
C* Datacenters Cloud Deployments
©2014 DataStax Confidential. Do not distribute without consent. 47
Availability
Zone 1
Availability
Zone 2
AWS
C* Datacenters Cloud Deployments
©2014 DataStax Confidential. Do not distribute without consent. 48
Availability
Zone 1
Availability
Zone 2
Google
Compute
Engine
AWS
C* Datacenters Cloud Deployments
©2014 DataStax Confidential. Do not distribute without consent. 49
Off-Cloud
Migration
On-Prem
Start in
Cloud

Weitere ähnliche Inhalte

Andere mochten auch

Announcing Spark Driver for Cassandra
Announcing Spark Driver for CassandraAnnouncing Spark Driver for Cassandra
Announcing Spark Driver for CassandraDataStax
 
Netflix Recommendations Using Spark + Cassandra (Prasanna Padmanabhan & Roopa...
Netflix Recommendations Using Spark + Cassandra (Prasanna Padmanabhan & Roopa...Netflix Recommendations Using Spark + Cassandra (Prasanna Padmanabhan & Roopa...
Netflix Recommendations Using Spark + Cassandra (Prasanna Padmanabhan & Roopa...DataStax
 
Cassandra EU 2012 - Netflix's Cassandra Architecture and Open Source Efforts
Cassandra EU 2012 - Netflix's Cassandra Architecture and Open Source EffortsCassandra EU 2012 - Netflix's Cassandra Architecture and Open Source Efforts
Cassandra EU 2012 - Netflix's Cassandra Architecture and Open Source EffortsAcunu
 
Tuning Speculative Retries to Fight Latency (Michael Figuiere, Minh Do, Netfl...
Tuning Speculative Retries to Fight Latency (Michael Figuiere, Minh Do, Netfl...Tuning Speculative Retries to Fight Latency (Michael Figuiere, Minh Do, Netfl...
Tuning Speculative Retries to Fight Latency (Michael Figuiere, Minh Do, Netfl...DataStax
 
What We Learned About Cassandra While Building go90 (Christopher Webster & Th...
What We Learned About Cassandra While Building go90 (Christopher Webster & Th...What We Learned About Cassandra While Building go90 (Christopher Webster & Th...
What We Learned About Cassandra While Building go90 (Christopher Webster & Th...DataStax
 
Data processing platforms architectures with Spark, Mesos, Akka, Cassandra an...
Data processing platforms architectures with Spark, Mesos, Akka, Cassandra an...Data processing platforms architectures with Spark, Mesos, Akka, Cassandra an...
Data processing platforms architectures with Spark, Mesos, Akka, Cassandra an...Anton Kirillov
 

Andere mochten auch (6)

Announcing Spark Driver for Cassandra
Announcing Spark Driver for CassandraAnnouncing Spark Driver for Cassandra
Announcing Spark Driver for Cassandra
 
Netflix Recommendations Using Spark + Cassandra (Prasanna Padmanabhan & Roopa...
Netflix Recommendations Using Spark + Cassandra (Prasanna Padmanabhan & Roopa...Netflix Recommendations Using Spark + Cassandra (Prasanna Padmanabhan & Roopa...
Netflix Recommendations Using Spark + Cassandra (Prasanna Padmanabhan & Roopa...
 
Cassandra EU 2012 - Netflix's Cassandra Architecture and Open Source Efforts
Cassandra EU 2012 - Netflix's Cassandra Architecture and Open Source EffortsCassandra EU 2012 - Netflix's Cassandra Architecture and Open Source Efforts
Cassandra EU 2012 - Netflix's Cassandra Architecture and Open Source Efforts
 
Tuning Speculative Retries to Fight Latency (Michael Figuiere, Minh Do, Netfl...
Tuning Speculative Retries to Fight Latency (Michael Figuiere, Minh Do, Netfl...Tuning Speculative Retries to Fight Latency (Michael Figuiere, Minh Do, Netfl...
Tuning Speculative Retries to Fight Latency (Michael Figuiere, Minh Do, Netfl...
 
What We Learned About Cassandra While Building go90 (Christopher Webster & Th...
What We Learned About Cassandra While Building go90 (Christopher Webster & Th...What We Learned About Cassandra While Building go90 (Christopher Webster & Th...
What We Learned About Cassandra While Building go90 (Christopher Webster & Th...
 
Data processing platforms architectures with Spark, Mesos, Akka, Cassandra an...
Data processing platforms architectures with Spark, Mesos, Akka, Cassandra an...Data processing platforms architectures with Spark, Mesos, Akka, Cassandra an...
Data processing platforms architectures with Spark, Mesos, Akka, Cassandra an...
 

Ähnlich wie Cassandra Day Chicago 2015: Cassandra Consistency & Tolerance (A Morality Guide for Databases)

How to size up an Apache Cassandra cluster (Training)
How to size up an Apache Cassandra cluster (Training)How to size up an Apache Cassandra cluster (Training)
How to size up an Apache Cassandra cluster (Training)DataStax Academy
 
Patrick Guillebert – IT-Tage 2015 – Cassandra NoSQL - Architektur und Anwendu...
Patrick Guillebert – IT-Tage 2015 – Cassandra NoSQL - Architektur und Anwendu...Patrick Guillebert – IT-Tage 2015 – Cassandra NoSQL - Architektur und Anwendu...
Patrick Guillebert – IT-Tage 2015 – Cassandra NoSQL - Architektur und Anwendu...Informatik Aktuell
 
Apache Cassandra For Java Developers - Why, What and How. LJC @ UCL October 2014
Apache Cassandra For Java Developers - Why, What and How. LJC @ UCL October 2014Apache Cassandra For Java Developers - Why, What and How. LJC @ UCL October 2014
Apache Cassandra For Java Developers - Why, What and How. LJC @ UCL October 2014Johnny Miller
 
Apache Cassandra and DataStax Enterprise Explained with Peter Halliday at Wil...
Apache Cassandra and DataStax Enterprise Explained with Peter Halliday at Wil...Apache Cassandra and DataStax Enterprise Explained with Peter Halliday at Wil...
Apache Cassandra and DataStax Enterprise Explained with Peter Halliday at Wil...DataStax Academy
 
Big Data Analytics with Spark
Big Data Analytics with SparkBig Data Analytics with Spark
Big Data Analytics with SparkDataStax Academy
 
Highly available, scalable and secure data with Cassandra and DataStax Enterp...
Highly available, scalable and secure data with Cassandra and DataStax Enterp...Highly available, scalable and secure data with Cassandra and DataStax Enterp...
Highly available, scalable and secure data with Cassandra and DataStax Enterp...Johnny Miller
 
Designing Resilient Application Platforms with Apache Cassandra - Hayato Shim...
Designing Resilient Application Platforms with Apache Cassandra - Hayato Shim...Designing Resilient Application Platforms with Apache Cassandra - Hayato Shim...
Designing Resilient Application Platforms with Apache Cassandra - Hayato Shim...jaxLondonConference
 
DataStax Enterprise & Apache Cassandra – Essentials for Financial Services – ...
DataStax Enterprise & Apache Cassandra – Essentials for Financial Services – ...DataStax Enterprise & Apache Cassandra – Essentials for Financial Services – ...
DataStax Enterprise & Apache Cassandra – Essentials for Financial Services – ...Daniel Cohen
 
Cassandra 2.0 to 2.1
Cassandra 2.0 to 2.1Cassandra 2.0 to 2.1
Cassandra 2.0 to 2.1Johnny Miller
 
Reporting from the Trenches: Intuit & Cassandra
Reporting from the Trenches: Intuit & CassandraReporting from the Trenches: Intuit & Cassandra
Reporting from the Trenches: Intuit & CassandraDataStax
 
Designing a Distributed Cloud Database for Dummies
Designing a Distributed Cloud Database for DummiesDesigning a Distributed Cloud Database for Dummies
Designing a Distributed Cloud Database for DummiesDataStax
 
Benefits of an Agile Data Fabric for Business Intelligence
Benefits of an Agile Data Fabric for Business IntelligenceBenefits of an Agile Data Fabric for Business Intelligence
Benefits of an Agile Data Fabric for Business IntelligenceDataWorks Summit/Hadoop Summit
 
Cassandra Day NY 2014: From Proof of Concept to Production
Cassandra Day NY 2014: From Proof of Concept to ProductionCassandra Day NY 2014: From Proof of Concept to Production
Cassandra Day NY 2014: From Proof of Concept to ProductionDataStax Academy
 
Introduction to cassandra 2014
Introduction to cassandra 2014Introduction to cassandra 2014
Introduction to cassandra 2014Patrick McFadin
 
Top 10 present and future innovations in the NoSQL Cassandra ecosystem (2022)
Top 10 present and future innovations in the NoSQL Cassandra ecosystem (2022)Top 10 present and future innovations in the NoSQL Cassandra ecosystem (2022)
Top 10 present and future innovations in the NoSQL Cassandra ecosystem (2022)Cédrick Lunven
 
Apache Cassandra and The Multi-Cloud by Amanda Moran
Apache Cassandra and The Multi-Cloud by Amanda MoranApache Cassandra and The Multi-Cloud by Amanda Moran
Apache Cassandra and The Multi-Cloud by Amanda MoranData Con LA
 
Manuel Hurtado. Couchbase paradigma4oct
Manuel Hurtado. Couchbase paradigma4octManuel Hurtado. Couchbase paradigma4oct
Manuel Hurtado. Couchbase paradigma4octParadigma Digital
 

Ähnlich wie Cassandra Day Chicago 2015: Cassandra Consistency & Tolerance (A Morality Guide for Databases) (20)

How to size up an Apache Cassandra cluster (Training)
How to size up an Apache Cassandra cluster (Training)How to size up an Apache Cassandra cluster (Training)
How to size up an Apache Cassandra cluster (Training)
 
Patrick Guillebert – IT-Tage 2015 – Cassandra NoSQL - Architektur und Anwendu...
Patrick Guillebert – IT-Tage 2015 – Cassandra NoSQL - Architektur und Anwendu...Patrick Guillebert – IT-Tage 2015 – Cassandra NoSQL - Architektur und Anwendu...
Patrick Guillebert – IT-Tage 2015 – Cassandra NoSQL - Architektur und Anwendu...
 
Apache Cassandra For Java Developers - Why, What and How. LJC @ UCL October 2014
Apache Cassandra For Java Developers - Why, What and How. LJC @ UCL October 2014Apache Cassandra For Java Developers - Why, What and How. LJC @ UCL October 2014
Apache Cassandra For Java Developers - Why, What and How. LJC @ UCL October 2014
 
Apache Cassandra and DataStax Enterprise Explained with Peter Halliday at Wil...
Apache Cassandra and DataStax Enterprise Explained with Peter Halliday at Wil...Apache Cassandra and DataStax Enterprise Explained with Peter Halliday at Wil...
Apache Cassandra and DataStax Enterprise Explained with Peter Halliday at Wil...
 
Big Data Analytics with Spark
Big Data Analytics with SparkBig Data Analytics with Spark
Big Data Analytics with Spark
 
Highly available, scalable and secure data with Cassandra and DataStax Enterp...
Highly available, scalable and secure data with Cassandra and DataStax Enterp...Highly available, scalable and secure data with Cassandra and DataStax Enterp...
Highly available, scalable and secure data with Cassandra and DataStax Enterp...
 
Designing Resilient Application Platforms with Apache Cassandra - Hayato Shim...
Designing Resilient Application Platforms with Apache Cassandra - Hayato Shim...Designing Resilient Application Platforms with Apache Cassandra - Hayato Shim...
Designing Resilient Application Platforms with Apache Cassandra - Hayato Shim...
 
DataStax TechDay - Munich 2014
DataStax TechDay - Munich 2014DataStax TechDay - Munich 2014
DataStax TechDay - Munich 2014
 
DataStax Enterprise & Apache Cassandra – Essentials for Financial Services – ...
DataStax Enterprise & Apache Cassandra – Essentials for Financial Services – ...DataStax Enterprise & Apache Cassandra – Essentials for Financial Services – ...
DataStax Enterprise & Apache Cassandra – Essentials for Financial Services – ...
 
Cassandra 2.0 (Introduction)
Cassandra 2.0 (Introduction)Cassandra 2.0 (Introduction)
Cassandra 2.0 (Introduction)
 
Cassandra 2.0 to 2.1
Cassandra 2.0 to 2.1Cassandra 2.0 to 2.1
Cassandra 2.0 to 2.1
 
Reporting from the Trenches: Intuit & Cassandra
Reporting from the Trenches: Intuit & CassandraReporting from the Trenches: Intuit & Cassandra
Reporting from the Trenches: Intuit & Cassandra
 
Designing a Distributed Cloud Database for Dummies
Designing a Distributed Cloud Database for DummiesDesigning a Distributed Cloud Database for Dummies
Designing a Distributed Cloud Database for Dummies
 
Benefits of an Agile Data Fabric for Business Intelligence
Benefits of an Agile Data Fabric for Business IntelligenceBenefits of an Agile Data Fabric for Business Intelligence
Benefits of an Agile Data Fabric for Business Intelligence
 
Cassandra Day NY 2014: From Proof of Concept to Production
Cassandra Day NY 2014: From Proof of Concept to ProductionCassandra Day NY 2014: From Proof of Concept to Production
Cassandra Day NY 2014: From Proof of Concept to Production
 
Introduction to cassandra 2014
Introduction to cassandra 2014Introduction to cassandra 2014
Introduction to cassandra 2014
 
Top 10 present and future innovations in the NoSQL Cassandra ecosystem (2022)
Top 10 present and future innovations in the NoSQL Cassandra ecosystem (2022)Top 10 present and future innovations in the NoSQL Cassandra ecosystem (2022)
Top 10 present and future innovations in the NoSQL Cassandra ecosystem (2022)
 
Apache Cassandra and The Multi-Cloud by Amanda Moran
Apache Cassandra and The Multi-Cloud by Amanda MoranApache Cassandra and The Multi-Cloud by Amanda Moran
Apache Cassandra and The Multi-Cloud by Amanda Moran
 
Manuel Hurtado. Couchbase paradigma4oct
Manuel Hurtado. Couchbase paradigma4octManuel Hurtado. Couchbase paradigma4oct
Manuel Hurtado. Couchbase paradigma4oct
 
BigData Developers MeetUp
BigData Developers MeetUpBigData Developers MeetUp
BigData Developers MeetUp
 

Mehr von DataStax Academy

Forrester CXNYC 2017 - Delivering great real-time cx is a true craft
Forrester CXNYC 2017 - Delivering great real-time cx is a true craftForrester CXNYC 2017 - Delivering great real-time cx is a true craft
Forrester CXNYC 2017 - Delivering great real-time cx is a true craftDataStax Academy
 
Introduction to DataStax Enterprise Graph Database
Introduction to DataStax Enterprise Graph DatabaseIntroduction to DataStax Enterprise Graph Database
Introduction to DataStax Enterprise Graph DatabaseDataStax Academy
 
Introduction to DataStax Enterprise Advanced Replication with Apache Cassandra
Introduction to DataStax Enterprise Advanced Replication with Apache CassandraIntroduction to DataStax Enterprise Advanced Replication with Apache Cassandra
Introduction to DataStax Enterprise Advanced Replication with Apache CassandraDataStax Academy
 
Cassandra on Docker @ Walmart Labs
Cassandra on Docker @ Walmart LabsCassandra on Docker @ Walmart Labs
Cassandra on Docker @ Walmart LabsDataStax Academy
 
Cassandra 3.0 Data Modeling
Cassandra 3.0 Data ModelingCassandra 3.0 Data Modeling
Cassandra 3.0 Data ModelingDataStax Academy
 
Cassandra Adoption on Cisco UCS & Open stack
Cassandra Adoption on Cisco UCS & Open stackCassandra Adoption on Cisco UCS & Open stack
Cassandra Adoption on Cisco UCS & Open stackDataStax Academy
 
Data Modeling for Apache Cassandra
Data Modeling for Apache CassandraData Modeling for Apache Cassandra
Data Modeling for Apache CassandraDataStax Academy
 
Production Ready Cassandra
Production Ready CassandraProduction Ready Cassandra
Production Ready CassandraDataStax Academy
 
Cassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & Python
Cassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & PythonCassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & Python
Cassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & PythonDataStax Academy
 
Cassandra @ Sony: The good, the bad, and the ugly part 1
Cassandra @ Sony: The good, the bad, and the ugly part 1Cassandra @ Sony: The good, the bad, and the ugly part 1
Cassandra @ Sony: The good, the bad, and the ugly part 1DataStax Academy
 
Cassandra @ Sony: The good, the bad, and the ugly part 2
Cassandra @ Sony: The good, the bad, and the ugly part 2Cassandra @ Sony: The good, the bad, and the ugly part 2
Cassandra @ Sony: The good, the bad, and the ugly part 2DataStax Academy
 
Standing Up Your First Cluster
Standing Up Your First ClusterStanding Up Your First Cluster
Standing Up Your First ClusterDataStax Academy
 
Real Time Analytics with Dse
Real Time Analytics with DseReal Time Analytics with Dse
Real Time Analytics with DseDataStax Academy
 
Introduction to Data Modeling with Apache Cassandra
Introduction to Data Modeling with Apache CassandraIntroduction to Data Modeling with Apache Cassandra
Introduction to Data Modeling with Apache CassandraDataStax Academy
 
Enabling Search in your Cassandra Application with DataStax Enterprise
Enabling Search in your Cassandra Application with DataStax EnterpriseEnabling Search in your Cassandra Application with DataStax Enterprise
Enabling Search in your Cassandra Application with DataStax EnterpriseDataStax Academy
 
Advanced Data Modeling with Apache Cassandra
Advanced Data Modeling with Apache CassandraAdvanced Data Modeling with Apache Cassandra
Advanced Data Modeling with Apache CassandraDataStax Academy
 

Mehr von DataStax Academy (20)

Forrester CXNYC 2017 - Delivering great real-time cx is a true craft
Forrester CXNYC 2017 - Delivering great real-time cx is a true craftForrester CXNYC 2017 - Delivering great real-time cx is a true craft
Forrester CXNYC 2017 - Delivering great real-time cx is a true craft
 
Introduction to DataStax Enterprise Graph Database
Introduction to DataStax Enterprise Graph DatabaseIntroduction to DataStax Enterprise Graph Database
Introduction to DataStax Enterprise Graph Database
 
Introduction to DataStax Enterprise Advanced Replication with Apache Cassandra
Introduction to DataStax Enterprise Advanced Replication with Apache CassandraIntroduction to DataStax Enterprise Advanced Replication with Apache Cassandra
Introduction to DataStax Enterprise Advanced Replication with Apache Cassandra
 
Cassandra on Docker @ Walmart Labs
Cassandra on Docker @ Walmart LabsCassandra on Docker @ Walmart Labs
Cassandra on Docker @ Walmart Labs
 
Cassandra 3.0 Data Modeling
Cassandra 3.0 Data ModelingCassandra 3.0 Data Modeling
Cassandra 3.0 Data Modeling
 
Cassandra Adoption on Cisco UCS & Open stack
Cassandra Adoption on Cisco UCS & Open stackCassandra Adoption on Cisco UCS & Open stack
Cassandra Adoption on Cisco UCS & Open stack
 
Data Modeling for Apache Cassandra
Data Modeling for Apache CassandraData Modeling for Apache Cassandra
Data Modeling for Apache Cassandra
 
Coursera Cassandra Driver
Coursera Cassandra DriverCoursera Cassandra Driver
Coursera Cassandra Driver
 
Production Ready Cassandra
Production Ready CassandraProduction Ready Cassandra
Production Ready Cassandra
 
Cassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & Python
Cassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & PythonCassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & Python
Cassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & Python
 
Cassandra @ Sony: The good, the bad, and the ugly part 1
Cassandra @ Sony: The good, the bad, and the ugly part 1Cassandra @ Sony: The good, the bad, and the ugly part 1
Cassandra @ Sony: The good, the bad, and the ugly part 1
 
Cassandra @ Sony: The good, the bad, and the ugly part 2
Cassandra @ Sony: The good, the bad, and the ugly part 2Cassandra @ Sony: The good, the bad, and the ugly part 2
Cassandra @ Sony: The good, the bad, and the ugly part 2
 
Standing Up Your First Cluster
Standing Up Your First ClusterStanding Up Your First Cluster
Standing Up Your First Cluster
 
Real Time Analytics with Dse
Real Time Analytics with DseReal Time Analytics with Dse
Real Time Analytics with Dse
 
Introduction to Data Modeling with Apache Cassandra
Introduction to Data Modeling with Apache CassandraIntroduction to Data Modeling with Apache Cassandra
Introduction to Data Modeling with Apache Cassandra
 
Cassandra Core Concepts
Cassandra Core ConceptsCassandra Core Concepts
Cassandra Core Concepts
 
Enabling Search in your Cassandra Application with DataStax Enterprise
Enabling Search in your Cassandra Application with DataStax EnterpriseEnabling Search in your Cassandra Application with DataStax Enterprise
Enabling Search in your Cassandra Application with DataStax Enterprise
 
Bad Habits Die Hard
Bad Habits Die Hard Bad Habits Die Hard
Bad Habits Die Hard
 
Advanced Data Modeling with Apache Cassandra
Advanced Data Modeling with Apache CassandraAdvanced Data Modeling with Apache Cassandra
Advanced Data Modeling with Apache Cassandra
 
Advanced Cassandra
Advanced CassandraAdvanced Cassandra
Advanced Cassandra
 

Kürzlich hochgeladen

WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
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
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
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
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
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
 

Kürzlich hochgeladen (20)

WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
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
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
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!
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
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
 

Cassandra Day Chicago 2015: Cassandra Consistency & Tolerance (A Morality Guide for Databases)

  • 1. Cassandra: Consistency & Tolerance (a morality guide for databases) Matt Kennedy, Architect @thetweetofmatt
  • 2. ©2014 DataStax Confidential. Do not distribute without consent. 2
  • 3. ©2014 DataStax Confidential. Do not distribute without consent. 3
  • 4. ©2014 DataStax Confidential. Do not distribute without consent. 4
  • 5. ©2014 DataStax Confidential. Do not distribute without consent. 5
  • 6. ©2014 DataStax Confidential. Do not distribute without consent. 6
  • 7. ©2014 DataStax Confidential. Do not distribute without consent. 7
  • 8. ©2014 DataStax Confidential. Do not distribute without consent. 8
  • 9. ©2014 DataStax Confidential. Do not distribute without consent. 9
  • 10. ©2014 DataStax Confidential. Do not distribute without consent. 10
  • 11. ©2014 DataStax Confidential. Do not distribute without consent. 11
  • 12. ©2014 DataStax Confidential. Do not distribute without consent. 12 ?
  • 13. ©2014 DataStax Confidential. Do not distribute without consent. 13 Georgetown American 20 minutes Worth the wait?
  • 14. ©2014 DataStax Confidential. Do not distribute without consent. 14 Georgetown American
  • 15. ©2014 DataStax Confidential. Do not distribute without consent. 15
  • 16. Lessons? •  High Availability means: •  Have to maintain some redundancy •  Need to distribute your stuff •  Distributed Stuff means: •  Need to accommodate unreliable networks •  Need to have strategies for different path costs •  Plan for outright failures •  Cooperation! Also, don’t underestimate a squirrel with a Jesuit education. ©2014 DataStax Confidential. Do not distribute without consent. 16
  • 17. ©2014 DataStax Confidential. Do not distribute without consent. 17
  • 18. ©2014 DataStax Confidential. Do not distribute without consent. 18 Eventual Consistency
  • 19. Meh. ©2014 DataStax Confidential. Do not distribute without consent. 19 http://nekrocodile-izumi.deviantart.com/art/Lazy-college-student-322186707
  • 20. ©2014 DataStax Confidential. Do not distribute without consent. 20
  • 21. ©2014 DataStax Confidential. Do not distribute without consent. 21
  • 22. ©2014 DataStax Confidential. Do not distribute without consent. 22
  • 23. Consistency vs. Consistency ©2014 DataStax Confidential. Do not distribute without consent. 23
  • 24. ©2014 DataStax Confidential. Do not distribute without consent. 24
  • 25. Tunable Consistency & High Availability ©2014 DataStax Confidential. Do not distribute without consent. 25 Example assumes replication factor = 3 write read
  • 26. Quorum-write, RF=5 ©2014 DataStax Confidential. Do not distribute without consent. 26 Client 6-node cluster, rf=5 OK!
  • 27. Quorum read RF=5 ©2014 DataStax Confidential. Do not distribute without consent. 27 Client 6-node cluster, rf=5 00101010 00101010 0010101000101010 ? ? Read value: 00101010
  • 28. ©2014 DataStax Confidential. Do not distribute without consent. 28
  • 29. Linearizable Consistency •  AKA: •  Compare & Set •  Check & Set •  Lightweight Transactions •  CQL “IF” Statements •  Uses Paxos •  Can specify local datacenter or all datacenters •  (CASSANDRA-5797) ©2014 DataStax Confidential. Do not distribute without consent. 29
  • 30. Linearizable Consistency •  Put X in the database if X is not already in the database •  Set foo=bar if foo=baz •  Set foo=bar if boo=faz ©2014 DataStax Confidential. Do not distribute without consent. 30
  • 31. ©2014 DataStax Confidential. Do not distribute without consent. 31 MONSTER MASH!!! Alice Bob Create “Stinky” C* Create “Stinky” Insert “Stinky” Insert “Stinky”Quorum insert Quorum insert Now Bob owns “Stinky” and Alice doesn’t know why she can’t see the monster she just made
  • 32. ©2014 DataStax Confidential. Do not distribute without consent. 32 MONSTER MASH!!! Alice Bob Create “Stinky” C* Create “Stinky” Insert “Stinky” Insert “Stinky” LWT Insert LWT insert NO!
  • 33. Consistency & Cassandra • Tunable Consistency • Linearizable Consistency • Your App can tell C* what it needs ©2014 DataStax Confidential. Do not distribute without consent. 33
  • 34. THIS IS IMPORTANT •  The Consistency Mechanisms are King •  Cassandra’s core strengths… •  High Availability •  Tolerance of node failures •  Tolerance of datacenter failures •  Tolerance of network failures between datacenters •  All due to the Consistency Mechanisms •  Cassandra isn’t Cassandra without Eventual Consistency ©2014 DataStax Confidential. Do not distribute without consent. 34
  • 35. Consistency is a Key Value! •  Get it? Key-Value? •  It’s a NoSQL joke. •  Always-on Big Data demands multi-region DCs •  Multi-region DCs must face the reality of network partitions •  Eventual Consistency enables applications built on Cassandra to do what they need to do correctly and flexibly while remaining constantly available. ©2014 DataStax Confidential. Do not distribute without consent. 35
  • 36. Thank You ©2014 DataStax Confidential. Do not distribute without consent.
  • 37. Tunable Consistency & High Availability ©2014 DataStax Confidential. Do not distribute without consent. 37 write read Example assumes replication factor = 3 1. 2. write read 3. Options 1 & 2 achieve strong consistency at the expense of availability. Option 3 requires only 2 replicas on write and 2 on read, so it achieves high availability & strong consistency.
  • 38. Eventual Consistency The Netflix Experiment •  “Eventual Consistency != Hopeful Consistency” •  Netflix, big C* user, performed an experiment ©2014 DataStax Confidential. Do not distribute without consent. 38 http://planetcassandra.org/blog/post/a-netflix-experiment-eventual-consistency-hopeful-consistency-by-christos-kalantzis/
  • 39. ©2014 DataStax Confidential. Do not distribute without consent. 39
  • 40. C* Datacenters A Single Cluster ©2014 DataStax Confidential. Do not distribute without consent. 40 One Datacenter Peer-to-peer ring of nodes
  • 41. Datacenters can go offline… ©2014 DataStax Confidential. Do not distribute without consent. 41
  • 42. For a variety of reasons ©2014 DataStax Confidential. Do not distribute without consent. 42
  • 43. C* Datacenters A Single Cluster ©2014 DataStax Confidential. Do not distribute without consent. 43 One Datacenter Peer-to-peer ring of nodes
  • 44. C* Datacenters What happens when I lose one? Los Angeles ©2014 DataStax Confidential. Do not distribute without consent. 44 Chicago New York
  • 45. C* Datacenters What is possible? Los Angeles ©2014 DataStax Confidential. Do not distribute without consent. 45 Chicago New York Cloud
  • 46. C* Datacenters Cloud Deployments ©2014 DataStax Confidential. Do not distribute without consent. 46 Availability Zone 1 AWS
  • 47. C* Datacenters Cloud Deployments ©2014 DataStax Confidential. Do not distribute without consent. 47 Availability Zone 1 Availability Zone 2 AWS
  • 48. C* Datacenters Cloud Deployments ©2014 DataStax Confidential. Do not distribute without consent. 48 Availability Zone 1 Availability Zone 2 Google Compute Engine AWS
  • 49. C* Datacenters Cloud Deployments ©2014 DataStax Confidential. Do not distribute without consent. 49 Off-Cloud Migration On-Prem Start in Cloud