際際滷

際際滷Share a Scribd company logo
ACritiqueoftheCAPTheorem
A paper by Martin Kleppmann
@trevmex
Disclaimer
Lets have a discussion.
Ask questions.
Make comments.
Share ideas.
@trevmex
TheBackground
The CAP Theorem in brief:
Pick two:
Consistency
Availability
Partition Tolerance
Formalized by Gilbert & Lynch in 2002.
@trevmex
TheBeef
Technically, Gilbert & Lynch are correct, but
What they proof is silly.
@trevmex
TheA
Fox & Brewer say availability is a system-level concern. 
Gilbert & Lynch define it at an algorithm-level :
For a distributed system to be continuously available, every
request received by a non-failing node in the system must
result in a response
@trevmex
TheC
Brewer calls consistency a spectrum. 
Gilbert & Lynch define it as the most strict type of
consistency: linearizability :
Linearizable distributed systems never allow for a stale
read.
@trevmex
TheP
Partition tolerance means that a partition in the system (two
parts of the system cannot communicate with each other) can
be tolerated.
What do we mean? Finite or infinite partitions?
@trevmex
Fair-lossLinks
A network link has the fair-loss property if the probability
of a message not being lost is non-zero, i.e. the link
sometimes delivers messages. The link may have intervals of
time during which all messages are dropped, but those
intervals must be of finite duration.
I.e. Not Byzantine, no deliberately malicious messages.
@trevmex
TheSilliness
Gilbert & Lynchs proof shows that you can only not have
linearizable and available distributed systems when there is
the possibility of infinite partitions.
If retry is possible, partitions are finite and latency is
not a concern, you can have all three: CAP.
@trevmex
ABetterWay
Let's concentrate on latency and service level agreements,
not consistency and availability.
That means talking about delays..
@trevmex
Delay-sensitivity
An algorithm is delay-sensitive if it need coordination to do
a read or write action.
Writes Reads
Linearizability
(e.g. The I in ACID)
O(d) O(d)
Sequential Consistency
(e.g. Paxos, Sirius)
O(d) O(1)
Causal Consistency
(i.e. non-related data may
be out of order)
O(1) O(1)
@trevmex
WANvs.LANDelays
A O(d) algorithm that only need coordination locally is
cheaper than one that need coordination globally:
O(dlocal) << O(dglobal)
@trevmex
ANewThinking
Availability is empirical (SLAs)
Delay-sensitive means an algorithm must coordinate
Network Faults (not just partitions)
Fault Tolerance means when does it break (not infinite)
Consistency is a spectrum (linearizability to eventual)@trevmex
Conclusion
CAP was helpful in the beginning.
But we can do better.
Lets start with delay-sensitivity and SLAs.
@trevmex
Ad

Recommended

Handling Byzantine Faults
Handling Byzantine Faults
awesomesos
Speed layer : Real time views in LAMBDA architecture
Speed layer : Real time views in LAMBDA architecture
Tin Ho
NYC* Jonathan Ellis Keynote: "Cassandra 1.2 + 2.0"
NYC* Jonathan Ellis Keynote: "Cassandra 1.2 + 2.0"
DataStax Academy
Data Pipelines & Integrating Real-time Web Services w/ Storm : Improving on t...
Data Pipelines & Integrating Real-time Web Services w/ Storm : Improving on t...
Brian O'Neill
Achieve big data analytic platform with lambda architecture on cloud
Achieve big data analytic platform with lambda architecture on cloud
Scott Miao
Re-envisioning the Lambda Architecture : Web Services & Real-time Analytics ...
Re-envisioning the Lambda Architecture : Web Services & Real-time Analytics ...
Brian O'Neill
DataEngConf SF16 - Unifying Real Time and Historical Analytics with the Lambd...
DataEngConf SF16 - Unifying Real Time and Historical Analytics with the Lambd...
Hakka Labs
Apache Flume - Streaming data easily to Hadoop from any source for Telco oper...
Apache Flume - Streaming data easily to Hadoop from any source for Telco oper...
DataWorks Summit
Lambda architecture on Spark, Kafka for real-time large scale ML
Lambda architecture on Spark, Kafka for real-time large scale ML
huguk
Real time machine learning
Real time machine learning
Vinoth Kannan
Arquitectura Lambda
Israel Gaytan
Extending Data Lake using the Lambda Architecture June 2015
Extending Data Lake using the Lambda Architecture June 2015
DataWorks Summit
Apache Storm vs. Spark Streaming - two stream processing platforms compared
Apache Storm vs. Spark Streaming - two stream processing platforms compared
Guido Schmutz
Big data real time architectures
Big data real time architectures
Daniel Marcous
Lambda Architecture with Spark, Spark Streaming, Kafka, Cassandra, Akka and S...
Lambda Architecture with Spark, Spark Streaming, Kafka, Cassandra, Akka and S...
Helena Edelson
Expresiones lambda
Cristian Camilo Palacio Cuartas
Lambda Architecture with Spark Streaming, Kafka, Cassandra, Akka, Scala
Lambda Architecture with Spark Streaming, Kafka, Cassandra, Akka, Scala
Helena Edelson
Apache storm vs. Spark Streaming
Apache storm vs. Spark Streaming
P. Taylor Goetz
Java Lambda
Eric Gustavo Coronel Castillo
BigData in BlockChains
BigData in BlockChains
Felix Crisan
All you didn't know about the CAP theorem
All you didn't know about the CAP theorem
Kanstantsin Hontarau
Design Patterns For Distributed NO-reational databases
Design Patterns For Distributed NO-reational databases
lovingprince58
Distributed computing for new bloods
Distributed computing for new bloods
Raymond Tay
A Critique of the CAP Theorem by Martin Kleppmann
A Critique of the CAP Theorem by Martin Kleppmann
mustafa sarac
Data consistency: Analyse, understand and decide
Data consistency: Analyse, understand and decide
Louis Jacomet
The CAP Theorem
The CAP Theorem
Aleksandar Bradic
Fault Tolerance (Distributed computing)
Fault Tolerance (Distributed computing)
Sri Prasanna
CAP and you
CAP and you
Andrew Shafer
Design Patterns for Distributed Non-Relational Databases
Design Patterns for Distributed Non-Relational Databases
guestdfd1ec
Cap Theorem
Cap Theorem
Micha omnicki

More Related Content

Viewers also liked (11)

Lambda architecture on Spark, Kafka for real-time large scale ML
Lambda architecture on Spark, Kafka for real-time large scale ML
huguk
Real time machine learning
Real time machine learning
Vinoth Kannan
Arquitectura Lambda
Israel Gaytan
Extending Data Lake using the Lambda Architecture June 2015
Extending Data Lake using the Lambda Architecture June 2015
DataWorks Summit
Apache Storm vs. Spark Streaming - two stream processing platforms compared
Apache Storm vs. Spark Streaming - two stream processing platforms compared
Guido Schmutz
Big data real time architectures
Big data real time architectures
Daniel Marcous
Lambda Architecture with Spark, Spark Streaming, Kafka, Cassandra, Akka and S...
Lambda Architecture with Spark, Spark Streaming, Kafka, Cassandra, Akka and S...
Helena Edelson
Expresiones lambda
Cristian Camilo Palacio Cuartas
Lambda Architecture with Spark Streaming, Kafka, Cassandra, Akka, Scala
Lambda Architecture with Spark Streaming, Kafka, Cassandra, Akka, Scala
Helena Edelson
Apache storm vs. Spark Streaming
Apache storm vs. Spark Streaming
P. Taylor Goetz
Java Lambda
Eric Gustavo Coronel Castillo
Lambda architecture on Spark, Kafka for real-time large scale ML
Lambda architecture on Spark, Kafka for real-time large scale ML
huguk
Real time machine learning
Real time machine learning
Vinoth Kannan
Arquitectura Lambda
Israel Gaytan
Extending Data Lake using the Lambda Architecture June 2015
Extending Data Lake using the Lambda Architecture June 2015
DataWorks Summit
Apache Storm vs. Spark Streaming - two stream processing platforms compared
Apache Storm vs. Spark Streaming - two stream processing platforms compared
Guido Schmutz
Big data real time architectures
Big data real time architectures
Daniel Marcous
Lambda Architecture with Spark, Spark Streaming, Kafka, Cassandra, Akka and S...
Lambda Architecture with Spark, Spark Streaming, Kafka, Cassandra, Akka and S...
Helena Edelson
Expresiones lambda
Cristian Camilo Palacio Cuartas
Lambda Architecture with Spark Streaming, Kafka, Cassandra, Akka, Scala
Lambda Architecture with Spark Streaming, Kafka, Cassandra, Akka, Scala
Helena Edelson
Apache storm vs. Spark Streaming
Apache storm vs. Spark Streaming
P. Taylor Goetz

Similar to A Critique of the CAP Theorem (Papers We Love @ Seattle) (20)

BigData in BlockChains
BigData in BlockChains
Felix Crisan
All you didn't know about the CAP theorem
All you didn't know about the CAP theorem
Kanstantsin Hontarau
Design Patterns For Distributed NO-reational databases
Design Patterns For Distributed NO-reational databases
lovingprince58
Distributed computing for new bloods
Distributed computing for new bloods
Raymond Tay
A Critique of the CAP Theorem by Martin Kleppmann
A Critique of the CAP Theorem by Martin Kleppmann
mustafa sarac
Data consistency: Analyse, understand and decide
Data consistency: Analyse, understand and decide
Louis Jacomet
The CAP Theorem
The CAP Theorem
Aleksandar Bradic
Fault Tolerance (Distributed computing)
Fault Tolerance (Distributed computing)
Sri Prasanna
CAP and you
CAP and you
Andrew Shafer
Design Patterns for Distributed Non-Relational Databases
Design Patterns for Distributed Non-Relational Databases
guestdfd1ec
Cap Theorem
Cap Theorem
Micha omnicki
fault tolerance1.pptx
fault tolerance1.pptx
rithika858339
Security for AWS : Journey to Least Privilege (update)
Security for AWS : Journey to Least Privilege (update)
dhubbard858
Security for AWS: Journey to Least Privilege
Security for AWS: Journey to Least Privilege
Lacework
Functional Programming with Immutable Data Structures
Functional Programming with Immutable Data Structures
elliando dias
PWLSD.1 A critique of the cap theorem - Martin Kleppmann
PWLSD.1 A critique of the cap theorem - Martin Kleppmann
Daniel Norman
Engineering Data Science Objectives for Social Network Analysis
Engineering Data Science Objectives for Social Network Analysis
David Gleich
Where to put_my_data
Where to put_my_data
Michael Nygard
DIY: A distributed database cluster, or: MySQL Cluster
DIY: A distributed database cluster, or: MySQL Cluster
Ulf Wendel
Computer Network notes
Computer Network notes
Liezon Pargin
BigData in BlockChains
BigData in BlockChains
Felix Crisan
All you didn't know about the CAP theorem
All you didn't know about the CAP theorem
Kanstantsin Hontarau
Design Patterns For Distributed NO-reational databases
Design Patterns For Distributed NO-reational databases
lovingprince58
Distributed computing for new bloods
Distributed computing for new bloods
Raymond Tay
A Critique of the CAP Theorem by Martin Kleppmann
A Critique of the CAP Theorem by Martin Kleppmann
mustafa sarac
Data consistency: Analyse, understand and decide
Data consistency: Analyse, understand and decide
Louis Jacomet
Fault Tolerance (Distributed computing)
Fault Tolerance (Distributed computing)
Sri Prasanna
Design Patterns for Distributed Non-Relational Databases
Design Patterns for Distributed Non-Relational Databases
guestdfd1ec
fault tolerance1.pptx
fault tolerance1.pptx
rithika858339
Security for AWS : Journey to Least Privilege (update)
Security for AWS : Journey to Least Privilege (update)
dhubbard858
Security for AWS: Journey to Least Privilege
Security for AWS: Journey to Least Privilege
Lacework
Functional Programming with Immutable Data Structures
Functional Programming with Immutable Data Structures
elliando dias
PWLSD.1 A critique of the cap theorem - Martin Kleppmann
PWLSD.1 A critique of the cap theorem - Martin Kleppmann
Daniel Norman
Engineering Data Science Objectives for Social Network Analysis
Engineering Data Science Objectives for Social Network Analysis
David Gleich
Where to put_my_data
Where to put_my_data
Michael Nygard
DIY: A distributed database cluster, or: MySQL Cluster
DIY: A distributed database cluster, or: MySQL Cluster
Ulf Wendel
Computer Network notes
Computer Network notes
Liezon Pargin
Ad

Recently uploaded (20)

feismo.com-dll-for-science-11-4th-pr_9ffe2eea16c7798a3e81949d38e20447.pdf
feismo.com-dll-for-science-11-4th-pr_9ffe2eea16c7798a3e81949d38e20447.pdf
RODULFOVPAQUINGAN
Gas Exchange in Insects and structures 01
Gas Exchange in Insects and structures 01
PhoebeAkinyi1
Paired Sketching of Distributed User Interfaces:Workflow, Protocol, Software ...
Paired Sketching of Distributed User Interfaces:Workflow, Protocol, Software ...
Jean Vanderdonckt
HERBAL INGREDIENTS USED IN ORAL CARE.pptx
HERBAL INGREDIENTS USED IN ORAL CARE.pptx
Vidhi889356
Relazione di laboratorio Idrolisi dell'amido (in inglese)
Relazione di laboratorio Idrolisi dell'amido (in inglese)
paolofvesco
STAPHYLOCOCCAL AND STREPTOCOCCAL INFECTIONS 2.ppt
STAPHYLOCOCCAL AND STREPTOCOCCAL INFECTIONS 2.ppt
pakranti27
Overview of Stem Cells and Immune Modulation.ppsx
Overview of Stem Cells and Immune Modulation.ppsx
AhmedAtwa29
Fake Science: Where it comes from and how to avoid beign part of it
Fake Science: Where it comes from and how to avoid beign part of it
Leonid Schneider
Science 10 1.3 Mountain Belts in the Philippines.pptx
Science 10 1.3 Mountain Belts in the Philippines.pptx
ClaireMangundayao1
An Analysis Of The Pearl Short Story By John Steinbeck
An Analysis Of The Pearl Short Story By John Steinbeck
BillyDarmawan3
It's about the habitat of organisms. Where they live and what they need to su...
It's about the habitat of organisms. Where they live and what they need to su...
KwabenaAbrokwah1
Instrumentation of IR and Raman Spectrophotometers.pptx
Instrumentation of IR and Raman Spectrophotometers.pptx
sngth2h2acc
THE CIRCULATORY SYSTEM GRADE 9 SCIENCE.pptx
THE CIRCULATORY SYSTEM GRADE 9 SCIENCE.pptx
roselyncatacutan
Study of Appropriate Information Combination in Image-based Obfuscated Malwar...
Study of Appropriate Information Combination in Image-based Obfuscated Malwar...
takahashi34
How Psychology Can Power Product Decisions: A Human-Centered Blueprint- Shray...
How Psychology Can Power Product Decisions: A Human-Centered Blueprint- Shray...
ShrayasiRoy
What is Skeleton system.pptx by aahil sir
What is Skeleton system.pptx by aahil sir
bhatbashir421
Properties of Gases siwhdhadpaldndn.pptx
Properties of Gases siwhdhadpaldndn.pptx
CatherineJadeBurce
What is Research Grade 7/ Research I.pptx
What is Research Grade 7/ Research I.pptx
delapenamhey144
Solution Chemistry Basics, molarity Molality
Solution Chemistry Basics, molarity Molality
nuralam819365
The Gender Binary & LGBTI People: Religious Myth and Medical Malpractice
The Gender Binary & LGBTI People: Religious Myth and Medical Malpractice
Veronica Drantz, PhD
feismo.com-dll-for-science-11-4th-pr_9ffe2eea16c7798a3e81949d38e20447.pdf
feismo.com-dll-for-science-11-4th-pr_9ffe2eea16c7798a3e81949d38e20447.pdf
RODULFOVPAQUINGAN
Gas Exchange in Insects and structures 01
Gas Exchange in Insects and structures 01
PhoebeAkinyi1
Paired Sketching of Distributed User Interfaces:Workflow, Protocol, Software ...
Paired Sketching of Distributed User Interfaces:Workflow, Protocol, Software ...
Jean Vanderdonckt
HERBAL INGREDIENTS USED IN ORAL CARE.pptx
HERBAL INGREDIENTS USED IN ORAL CARE.pptx
Vidhi889356
Relazione di laboratorio Idrolisi dell'amido (in inglese)
Relazione di laboratorio Idrolisi dell'amido (in inglese)
paolofvesco
STAPHYLOCOCCAL AND STREPTOCOCCAL INFECTIONS 2.ppt
STAPHYLOCOCCAL AND STREPTOCOCCAL INFECTIONS 2.ppt
pakranti27
Overview of Stem Cells and Immune Modulation.ppsx
Overview of Stem Cells and Immune Modulation.ppsx
AhmedAtwa29
Fake Science: Where it comes from and how to avoid beign part of it
Fake Science: Where it comes from and how to avoid beign part of it
Leonid Schneider
Science 10 1.3 Mountain Belts in the Philippines.pptx
Science 10 1.3 Mountain Belts in the Philippines.pptx
ClaireMangundayao1
An Analysis Of The Pearl Short Story By John Steinbeck
An Analysis Of The Pearl Short Story By John Steinbeck
BillyDarmawan3
It's about the habitat of organisms. Where they live and what they need to su...
It's about the habitat of organisms. Where they live and what they need to su...
KwabenaAbrokwah1
Instrumentation of IR and Raman Spectrophotometers.pptx
Instrumentation of IR and Raman Spectrophotometers.pptx
sngth2h2acc
THE CIRCULATORY SYSTEM GRADE 9 SCIENCE.pptx
THE CIRCULATORY SYSTEM GRADE 9 SCIENCE.pptx
roselyncatacutan
Study of Appropriate Information Combination in Image-based Obfuscated Malwar...
Study of Appropriate Information Combination in Image-based Obfuscated Malwar...
takahashi34
How Psychology Can Power Product Decisions: A Human-Centered Blueprint- Shray...
How Psychology Can Power Product Decisions: A Human-Centered Blueprint- Shray...
ShrayasiRoy
What is Skeleton system.pptx by aahil sir
What is Skeleton system.pptx by aahil sir
bhatbashir421
Properties of Gases siwhdhadpaldndn.pptx
Properties of Gases siwhdhadpaldndn.pptx
CatherineJadeBurce
What is Research Grade 7/ Research I.pptx
What is Research Grade 7/ Research I.pptx
delapenamhey144
Solution Chemistry Basics, molarity Molality
Solution Chemistry Basics, molarity Molality
nuralam819365
The Gender Binary & LGBTI People: Religious Myth and Medical Malpractice
The Gender Binary & LGBTI People: Religious Myth and Medical Malpractice
Veronica Drantz, PhD
Ad

A Critique of the CAP Theorem (Papers We Love @ Seattle)

  • 1. ACritiqueoftheCAPTheorem A paper by Martin Kleppmann @trevmex
  • 2. Disclaimer Lets have a discussion. Ask questions. Make comments. Share ideas. @trevmex
  • 3. TheBackground The CAP Theorem in brief: Pick two: Consistency Availability Partition Tolerance Formalized by Gilbert & Lynch in 2002. @trevmex
  • 4. TheBeef Technically, Gilbert & Lynch are correct, but What they proof is silly. @trevmex
  • 5. TheA Fox & Brewer say availability is a system-level concern. Gilbert & Lynch define it at an algorithm-level : For a distributed system to be continuously available, every request received by a non-failing node in the system must result in a response @trevmex
  • 6. TheC Brewer calls consistency a spectrum. Gilbert & Lynch define it as the most strict type of consistency: linearizability : Linearizable distributed systems never allow for a stale read. @trevmex
  • 7. TheP Partition tolerance means that a partition in the system (two parts of the system cannot communicate with each other) can be tolerated. What do we mean? Finite or infinite partitions? @trevmex
  • 8. Fair-lossLinks A network link has the fair-loss property if the probability of a message not being lost is non-zero, i.e. the link sometimes delivers messages. The link may have intervals of time during which all messages are dropped, but those intervals must be of finite duration. I.e. Not Byzantine, no deliberately malicious messages. @trevmex
  • 9. TheSilliness Gilbert & Lynchs proof shows that you can only not have linearizable and available distributed systems when there is the possibility of infinite partitions. If retry is possible, partitions are finite and latency is not a concern, you can have all three: CAP. @trevmex
  • 10. ABetterWay Let's concentrate on latency and service level agreements, not consistency and availability. That means talking about delays.. @trevmex
  • 11. Delay-sensitivity An algorithm is delay-sensitive if it need coordination to do a read or write action. Writes Reads Linearizability (e.g. The I in ACID) O(d) O(d) Sequential Consistency (e.g. Paxos, Sirius) O(d) O(1) Causal Consistency (i.e. non-related data may be out of order) O(1) O(1) @trevmex
  • 12. WANvs.LANDelays A O(d) algorithm that only need coordination locally is cheaper than one that need coordination globally: O(dlocal) << O(dglobal) @trevmex
  • 13. ANewThinking Availability is empirical (SLAs) Delay-sensitive means an algorithm must coordinate Network Faults (not just partitions) Fault Tolerance means when does it break (not infinite) Consistency is a spectrum (linearizability to eventual)@trevmex
  • 14. Conclusion CAP was helpful in the beginning. But we can do better. Lets start with delay-sensitivity and SLAs. @trevmex

Editor's Notes

  • #6: Regardless of latency! Only non-failing nodes!
  • #10: Technically correct, but not interesting.