SlideShare ist ein Scribd-Unternehmen logo
1 von 24
Beyond Strong 
Consistency 
Models for Consistency in High Performance 
Distributed Systems 
John L. Singleton 
University of Central Florida
A Motivating Example 
“Represents” 
What Happens if we delete a friend from my social graph?
The Problem of Scalability 
del(fn) 
query(f) 
Strong Consistency: With a single database, 
all users see the update after it is committed
The Problem of Scalability (continued) 
Strong Consistency: As more 
database servers are added to 
handle the load, update latency 
increases 
DB1 
query(f) 
del(fn) 
query(f) 
DBn 
sync(f)
The Problem: Scaling a Model of 
Consistency 
• Strong Consistency requires that every update is immediately 
propagated to all nodes. 
• All users have the same view of the data at any moment. 
• However, this is bad for performance and is hard to scale. 
How can we implement a model of consistency that scales?
The CAP “Theorem” 
• Uttered by Eric Brewer at PODC circa 2000 
• Consistency: All users see the same view of the data 
• Availability: The system is always available 
• Partition Tolerance: The system can operate in the presence 
of network failures between nodes. 
• Not really a theorem because no proof of its validity exists.
Some Criticism of the CAP Theorem 
• In the world of NoSQL databases, CAP has been used as an 
excuse to give up consistency 
• However, the cases they are optimizing for (for example, 
partition tolerance) are in fact the most rare 
• Network partition in a local cluster 
• Failure of a single node is much more common 
“One should not throw out the C so quickly, since there are real error 
scenarios where CAP does not apply and it seems like a bad tradeoff in 
many of the other situations.” – Michael Stonebraker
One Possible Solution: Eventual 
Consistency 
Asks the question: “What if we omit the C?” 
• Do updates locally and propagate the changes 
• No foreground synchronization 
• Resists partitioning 
• Requires consensus 
• Consistency is eventual, no definite point in the future.
Some Preliminaries: State-Based Objects 
• Two Views of an Object: State Based and Operation Based 
• State Based: Object is a collection of state transitions
The State-Based View
Causal History of State-Based Objects 
• We need an abstraction to reason about the state an object 
may be in (or may have come from) 
• Each replica can maintain a copy of the causal history.
Definition of Eventual Consistency 
Eventual Delivery: An update delivered at some correct replica 
is eventually delivered to all correct replicas: 
Convergence: Correct replicas that have delivered the same 
updates eventually reach equivalent state: 
Termination: All method executions terminate
Problems with Eventual Consistency 
The Strong Consistency Model 
• In the strong consistency model, users get a 
single view in a specific order, therefore no 
conflicts 
a 
s2.add(a,b) s1.del(a) 
b 
time (increasing)
Problems with Eventual Consistency 
The Eventually Consistency Model 
• This update is invalid! 
• Measures must be taken to handle conflicts 
and perform rollbacks to ensure consistency 
• This results in overhead to the system and 
should be avoided 
a 
s2.del(a) s1.add(a,b) 
b 
time (increasing)
Eventual Delivery: An update delivered at some correct replica 
is eventually delivered to all correct replicas: 
Convergence: Correct replicas that have delivered the same 
updates eventually reach equivalent state: 
Termination: All method executions terminate 
Strong Convergence: Correct replicas that have delivered the 
same updates have equivalent state:
Strong Eventual Consistency 
• Strong Eventual Consistency is a stronger subset of Eventual 
Consistency 
• By placing restrictions on the way in which replicated types are 
constructed, we can provide stronger guarantees. 
• Most importantly: SEC is a solution to the CAP problem 
• Can tolerate up to n-1 concurrent crashes 
• Does not require consensus 
• Is weaker than strong consistency, but provides performance benefits 
and a well defined consistency model. 
• Removes conflicts
Conflict Free Replicated Data Types 
• The key to Strong Eventual Consistency is the Convergent 
Replicated Data Type (CvRDT) 
• Constructed with a monotonic semi-lattice object 
• A set with a partial order 
• And an operation that can find the least upper bound on any two 
objects in the set such that:
CvRDTs and Monotonic Semi-Lattices 
If these conditions are satisfied, you have a CvRDT 
(technical note: State-Based RDTs are equivalent to 
Operation Based RDTs)
Sample CvRDT: A Integer Vector
Set-Based CvRDT 
• How could we apply this idea to a more complex object like a 
set? 
• Create one set, the Addition set, and record all elements added 
• Create another set, the Remove set, and record all elements 
removed. 
• Both sets are monotonic 
• Define the query function as:
Conclusions 
• Introduced the idea of multiple models of consistency: 
• Strong Consistency 
• Eventual Consistency 
• Strong Eventual Consistency 
• Discussed the CAP Theorem and showed how 
performance problems with Strong Consistency lead to 
Eventual Consistency 
• Demonstrated how problems with Eventual Consistency 
can arise 
• Showed how Strong Eventual Consistency is a solution to 
the CAP problem, and can improve the performance and 
reliability of distributed data store systems.
References 
[1] Deftu, Andrei, and Jan Griebsch. "A Scalable Conflict-Free Replicated Set Data Type." 
In Distributed Computing Systems (ICDCS), 2013 IEEE 33rd International Conference on, pp. 186- 
195. IEEE, 2013. 
[2] Shapiro, Marc, Nuno Preguiça, Carlos Baquero, and Marek Zawirski. "Conflict-free replicated data 
types." In Stabilization, Safety, and Security of Distributed Systems, pp. 386-400. Springer Berlin 
Heidelberg, 2011. 
[3] Bouajjani, Ahmed, Constantin Enea, and Jad Hamza. "Verifying eventual consistency of optimistic 
replication systems." In Proceedings of the 41st annual ACM SIGPLAN-SIGACT symposium on 
Principles of programming languages, pp. 285-296. ACM, 2014. 
[4] Vogels, Werner. "Eventually consistent." Communications of the ACM 52, no. 1 (2009): 40-44. 
[5] Stonebraker, Michael. "Errors in database systems, eventual consistency, and the cap 
theorem." Communications of the ACM, BLOG@ ACM (2010). 
[6] Brewer, Eric A. "Towards robust distributed systems." In PODC, p. 7. 2000. 
[7] Lamport, Leslie. "Time, clocks, and the ordering of events in a distributed 
system." Communications of the ACM 21, no. 7 (1978): 558-565. 
[8] Gilbert, Seth, and Nancy Lynch. "Brewer’s Conjecture and the Feasibility of Consistent." Available, 
Partition-Tolerant Web Services. doi 10, no. 564585.564601 (2002).
Questions?

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (13)

Real-Time Design Patterns
Real-Time Design PatternsReal-Time Design Patterns
Real-Time Design Patterns
 
No sql (not only sql)
No sql                 (not only sql)No sql                 (not only sql)
No sql (not only sql)
 
Database Throwdown Introduction
Database Throwdown IntroductionDatabase Throwdown Introduction
Database Throwdown Introduction
 
Cluster
ClusterCluster
Cluster
 
CAP theorem and distributed systems
CAP theorem and distributed systemsCAP theorem and distributed systems
CAP theorem and distributed systems
 
Akka and Kubernetes, the beginning of a beautiful relationship
Akka and Kubernetes, the beginning of a beautiful relationshipAkka and Kubernetes, the beginning of a beautiful relationship
Akka and Kubernetes, the beginning of a beautiful relationship
 
An Overview of Distributed Debugging
An Overview of Distributed DebuggingAn Overview of Distributed Debugging
An Overview of Distributed Debugging
 
Cluster computing
Cluster computingCluster computing
Cluster computing
 
Client Centric Consistency Model
Client Centric Consistency ModelClient Centric Consistency Model
Client Centric Consistency Model
 
API Performance testing with Gatling
API Performance testing with GatlingAPI Performance testing with Gatling
API Performance testing with Gatling
 
Consistency protocols
Consistency protocolsConsistency protocols
Consistency protocols
 
1 untitled 1ppt
1 untitled 1ppt1 untitled 1ppt
1 untitled 1ppt
 
A Critique of the CAP Theorem by Martin Kleppmann
A Critique of the CAP Theorem by Martin KleppmannA Critique of the CAP Theorem by Martin Kleppmann
A Critique of the CAP Theorem by Martin Kleppmann
 

Ähnlich wie Beyond Strong Consistency

This is introduction to distributed systems for the revised curiculum
This is introduction to distributed systems for the revised curiculumThis is introduction to distributed systems for the revised curiculum
This is introduction to distributed systems for the revised curiculum
meharikiros2
 
Lecture-04-Principles of data management.pdf
Lecture-04-Principles of data management.pdfLecture-04-Principles of data management.pdf
Lecture-04-Principles of data management.pdf
manimozhi98
 
Managing Dynamic Shared state
Managing Dynamic Shared stateManaging Dynamic Shared state
Managing Dynamic Shared state
Aditya Gupta
 
HbaseHivePigbyRohitDubey
HbaseHivePigbyRohitDubeyHbaseHivePigbyRohitDubey
HbaseHivePigbyRohitDubey
Rohit Dubey
 

Ähnlich wie Beyond Strong Consistency (20)

ds7_con.ppt
ds7_con.pptds7_con.ppt
ds7_con.ppt
 
CAP Theorem and Split Brain Syndrome
CAP Theorem and Split Brain SyndromeCAP Theorem and Split Brain Syndrome
CAP Theorem and Split Brain Syndrome
 
Lightning talk: highly scalable databases and the PACELC theorem
Lightning talk: highly scalable databases and the PACELC theoremLightning talk: highly scalable databases and the PACELC theorem
Lightning talk: highly scalable databases and the PACELC theorem
 
cse40822-CAP.pptx
cse40822-CAP.pptxcse40822-CAP.pptx
cse40822-CAP.pptx
 
Chapter Introductionn to distributed system .pptx
Chapter Introductionn to distributed system .pptxChapter Introductionn to distributed system .pptx
Chapter Introductionn to distributed system .pptx
 
Cap in depth
Cap in depthCap in depth
Cap in depth
 
CAP Theorem - Theory, Implications and Practices
CAP Theorem - Theory, Implications and PracticesCAP Theorem - Theory, Implications and Practices
CAP Theorem - Theory, Implications and Practices
 
This is introduction to distributed systems for the revised curiculum
This is introduction to distributed systems for the revised curiculumThis is introduction to distributed systems for the revised curiculum
This is introduction to distributed systems for the revised curiculum
 
chen-06.ppt
chen-06.pptchen-06.ppt
chen-06.ppt
 
Lecture-04-Principles of data management.pdf
Lecture-04-Principles of data management.pdfLecture-04-Principles of data management.pdf
Lecture-04-Principles of data management.pdf
 
Digital Transformation with Kubernetes, Containers, and Microservices
Digital Transformation with Kubernetes, Containers, and MicroservicesDigital Transformation with Kubernetes, Containers, and Microservices
Digital Transformation with Kubernetes, Containers, and Microservices
 
Managing Dynamic Shared state
Managing Dynamic Shared stateManaging Dynamic Shared state
Managing Dynamic Shared state
 
Performance Testing in Production - Leveraging the Universal Scalability Law
Performance Testing in Production - Leveraging the Universal Scalability LawPerformance Testing in Production - Leveraging the Universal Scalability Law
Performance Testing in Production - Leveraging the Universal Scalability Law
 
Microservices, Kubernetes, and Application Modernization Done Right
Microservices, Kubernetes, and Application Modernization Done RightMicroservices, Kubernetes, and Application Modernization Done Right
Microservices, Kubernetes, and Application Modernization Done Right
 
Nosql availability & integrity
Nosql availability & integrityNosql availability & integrity
Nosql availability & integrity
 
Consistency of data replication
Consistency of data replicationConsistency of data replication
Consistency of data replication
 
Introduction
IntroductionIntroduction
Introduction
 
dist_systems.pdf
dist_systems.pdfdist_systems.pdf
dist_systems.pdf
 
Maintaining data consistency in
Maintaining data consistency inMaintaining data consistency in
Maintaining data consistency in
 
HbaseHivePigbyRohitDubey
HbaseHivePigbyRohitDubeyHbaseHivePigbyRohitDubey
HbaseHivePigbyRohitDubey
 

KĂźrzlich hochgeladen

Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
Epec Engineered Technologies
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
MsecMca
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
jaanualu31
 

KĂźrzlich hochgeladen (20)

Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planes
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Air Compressor reciprocating single stage
Air Compressor reciprocating single stageAir Compressor reciprocating single stage
Air Compressor reciprocating single stage
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 

Beyond Strong Consistency

  • 1. Beyond Strong Consistency Models for Consistency in High Performance Distributed Systems John L. Singleton University of Central Florida
  • 2. A Motivating Example “Represents” What Happens if we delete a friend from my social graph?
  • 3. The Problem of Scalability del(fn) query(f) Strong Consistency: With a single database, all users see the update after it is committed
  • 4. The Problem of Scalability (continued) Strong Consistency: As more database servers are added to handle the load, update latency increases DB1 query(f) del(fn) query(f) DBn sync(f)
  • 5. The Problem: Scaling a Model of Consistency • Strong Consistency requires that every update is immediately propagated to all nodes. • All users have the same view of the data at any moment. • However, this is bad for performance and is hard to scale. How can we implement a model of consistency that scales?
  • 6. The CAP “Theorem” • Uttered by Eric Brewer at PODC circa 2000 • Consistency: All users see the same view of the data • Availability: The system is always available • Partition Tolerance: The system can operate in the presence of network failures between nodes. • Not really a theorem because no proof of its validity exists.
  • 7.
  • 8. Some Criticism of the CAP Theorem • In the world of NoSQL databases, CAP has been used as an excuse to give up consistency • However, the cases they are optimizing for (for example, partition tolerance) are in fact the most rare • Network partition in a local cluster • Failure of a single node is much more common “One should not throw out the C so quickly, since there are real error scenarios where CAP does not apply and it seems like a bad tradeoff in many of the other situations.” – Michael Stonebraker
  • 9. One Possible Solution: Eventual Consistency Asks the question: “What if we omit the C?” • Do updates locally and propagate the changes • No foreground synchronization • Resists partitioning • Requires consensus • Consistency is eventual, no definite point in the future.
  • 10. Some Preliminaries: State-Based Objects • Two Views of an Object: State Based and Operation Based • State Based: Object is a collection of state transitions
  • 12. Causal History of State-Based Objects • We need an abstraction to reason about the state an object may be in (or may have come from) • Each replica can maintain a copy of the causal history.
  • 13. Definition of Eventual Consistency Eventual Delivery: An update delivered at some correct replica is eventually delivered to all correct replicas: Convergence: Correct replicas that have delivered the same updates eventually reach equivalent state: Termination: All method executions terminate
  • 14. Problems with Eventual Consistency The Strong Consistency Model • In the strong consistency model, users get a single view in a specific order, therefore no conflicts a s2.add(a,b) s1.del(a) b time (increasing)
  • 15. Problems with Eventual Consistency The Eventually Consistency Model • This update is invalid! • Measures must be taken to handle conflicts and perform rollbacks to ensure consistency • This results in overhead to the system and should be avoided a s2.del(a) s1.add(a,b) b time (increasing)
  • 16. Eventual Delivery: An update delivered at some correct replica is eventually delivered to all correct replicas: Convergence: Correct replicas that have delivered the same updates eventually reach equivalent state: Termination: All method executions terminate Strong Convergence: Correct replicas that have delivered the same updates have equivalent state:
  • 17. Strong Eventual Consistency • Strong Eventual Consistency is a stronger subset of Eventual Consistency • By placing restrictions on the way in which replicated types are constructed, we can provide stronger guarantees. • Most importantly: SEC is a solution to the CAP problem • Can tolerate up to n-1 concurrent crashes • Does not require consensus • Is weaker than strong consistency, but provides performance benefits and a well defined consistency model. • Removes conflicts
  • 18. Conflict Free Replicated Data Types • The key to Strong Eventual Consistency is the Convergent Replicated Data Type (CvRDT) • Constructed with a monotonic semi-lattice object • A set with a partial order • And an operation that can find the least upper bound on any two objects in the set such that:
  • 19. CvRDTs and Monotonic Semi-Lattices If these conditions are satisfied, you have a CvRDT (technical note: State-Based RDTs are equivalent to Operation Based RDTs)
  • 20. Sample CvRDT: A Integer Vector
  • 21. Set-Based CvRDT • How could we apply this idea to a more complex object like a set? • Create one set, the Addition set, and record all elements added • Create another set, the Remove set, and record all elements removed. • Both sets are monotonic • Define the query function as:
  • 22. Conclusions • Introduced the idea of multiple models of consistency: • Strong Consistency • Eventual Consistency • Strong Eventual Consistency • Discussed the CAP Theorem and showed how performance problems with Strong Consistency lead to Eventual Consistency • Demonstrated how problems with Eventual Consistency can arise • Showed how Strong Eventual Consistency is a solution to the CAP problem, and can improve the performance and reliability of distributed data store systems.
  • 23. References [1] Deftu, Andrei, and Jan Griebsch. "A Scalable Conflict-Free Replicated Set Data Type." In Distributed Computing Systems (ICDCS), 2013 IEEE 33rd International Conference on, pp. 186- 195. IEEE, 2013. [2] Shapiro, Marc, Nuno Preguiça, Carlos Baquero, and Marek Zawirski. "Conflict-free replicated data types." In Stabilization, Safety, and Security of Distributed Systems, pp. 386-400. Springer Berlin Heidelberg, 2011. [3] Bouajjani, Ahmed, Constantin Enea, and Jad Hamza. "Verifying eventual consistency of optimistic replication systems." In Proceedings of the 41st annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages, pp. 285-296. ACM, 2014. [4] Vogels, Werner. "Eventually consistent." Communications of the ACM 52, no. 1 (2009): 40-44. [5] Stonebraker, Michael. "Errors in database systems, eventual consistency, and the cap theorem." Communications of the ACM, BLOG@ ACM (2010). [6] Brewer, Eric A. "Towards robust distributed systems." In PODC, p. 7. 2000. [7] Lamport, Leslie. "Time, clocks, and the ordering of events in a distributed system." Communications of the ACM 21, no. 7 (1978): 558-565. [8] Gilbert, Seth, and Nancy Lynch. "Brewer’s Conjecture and the Feasibility of Consistent." Available, Partition-Tolerant Web Services. doi 10, no. 564585.564601 (2002).