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

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 

Kürzlich hochgeladen (20)

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 

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