SlideShare ist ein Scribd-Unternehmen logo
1 von 19
Downloaden Sie, um offline zu lesen
Eventually
                        Consistent
                         wspringer@xebia.com




woensdag 21 juli 2010
Werner
                        Vogels




woensdag 21 juli 2010
‘60s         ‘90s
                  Distribution   Minimize
                 Transparency     Failure

woensdag 21 juli 2010
Client
                        Perspective




woensdag 21 juli 2010
Model

                                    B
                        A
                                    C


woensdag 21 juli 2010
Strong Consistency
                                       1
                                                   0   value = "foo"

                                           value = "bar"                2
                                                                                       B
                            A
                                                                       value = "bar"


                                                                        2



                                                                                       C
                                       2                        value = "bar"
                                           value = "bar"




                        After the update, any subsequent access will return the
                        updated value.




woensdag 21 juli 2010
Weak Consistency
                                                                                           B
                                                   0     value = "foo"

                                                                          >1
                                        1   value = "bar"




                              A
                                                                   value = "bar" / "foo"


                                                                          >1




                                                                                           C
                                            value = "bar" /    value = "bar" / "foo"
                                       >1       "foo"




                        The system does not guarantee that at any given point in
                        the future subsequent access will return the updated
                        value




woensdag 21 juli 2010
Eventual Consistency
                                                                                          B
                                                     0    value = "foo"

                                           1   value = "bar"                t



                              A
                                                                          value = "bar"


                                                                                t




                                                                                          C
                                                                   value = "bar"
                                       t       value = "bar"


                                                  t≥1




                        If no updates are made to the object, eventually all
                        accesses will return the last updated value.




woensdag 21 juli 2010
Causal Consistency
                                            2   notification of update




                                                                                        B
                                                  0    value = "foo"

                                        1   value = "bar"                3



                                A
                                                                        value = "bar"


                                                                             3




                                                                                        C
                                                                 value = "foo"




                        Subsequent access by process B will return the updated
                        value, and a write is guaranteed to supersede the earlier
                        write.




woensdag 21 juli 2010
Read-your-writes
                                 Consistency
                                                                        B
                                                   0    value = "foo"

                                         1   value = "bar"




                               A
                                                                        C
                                         2   value = "bar"




                        Process A, after updating a data item always access the
                        updated value and never sees an older value




woensdag 21 juli 2010
Session Consistency
                                                                                   B
                                  Session 1
                                                               0   value = "foo"

                                         1    value = "bar"




                              A           2   value = "bar"




                                          2    value = "foo"
                                                                                   C
                                  Session 2



                        Within the “session”, the system guarantees read-your-
                        writes consistency




woensdag 21 juli 2010
Monotonic Read
                                  Consistency
                                                                                 B
                                                             0   value = "foo"



                                                                 value = "bar"



                             A
                                                                        3
                                         1   value = "foo"




                                                                                 C
                                         2   value = "foo"

                                         4   value = "bar"



                        If a process has seen a particular value for the object, any
                        subsequent access will never return any previous values




woensdag 21 juli 2010
Monotonic Write
                                 Consistency
                                                                                B
                                                            0   value = "foo"




                             A
                                            value = "bar"
                                       1


                                       2



                                                                                C
                                           value = "last"




                        The system guarantees to serialize the writes by the
                        same process




woensdag 21 juli 2010
Eventual Consistentency
                              in RDBMS
                                                         Log shipping


                                               Primary                  Backup replica




                             A
                                      1

                                                          async
                                      2

                                          3




                        Eventual consistency is not just a property of NoSQL
                        Solutions




woensdag 21 juli 2010
Server
                        Perspective




woensdag 21 juli 2010
NRW

                        N The number of nodes that store replicates of the data
                        W The number of replicas that need to acknowledge the
                           receipt of the update before the update completes

                        R The number of replicas that are contacted when a data
                           object is accessed through a read operation




woensdag 21 juli 2010
Strong Consistency
                                             W=3                   value = "foo"



                                                   value = "foo"




                                     A
                                                                   value = "foo"




                              N=4
                                                                   value = "foo"




                                              R=2
                        W + R > N implies strong consistency




woensdag 21 juli 2010
Optimizations


                        • Optimize read: R = 1, N = W
                        • Optimize write: W = 1, N = R




woensdag 21 juli 2010
Design Considerations


                        • Clients implementing read-your-writes and monotonic
                           reads, by adding versions on writes, and discarding
                           everything the precedes the last-seen version.




woensdag 21 juli 2010

Weitere ähnliche Inhalte

Was ist angesagt?

Array implementation and linked list as datat structure
Array implementation and linked list as datat structureArray implementation and linked list as datat structure
Array implementation and linked list as datat structure
Tushar Aneyrao
 
Decoders
DecodersDecoders
Decoders
Re Man
 
Graphs In Data Structure
Graphs In Data StructureGraphs In Data Structure
Graphs In Data Structure
Anuj Modi
 

Was ist angesagt? (20)

Searching
SearchingSearching
Searching
 
Hash table in data structure and algorithm
Hash table in data structure and algorithmHash table in data structure and algorithm
Hash table in data structure and algorithm
 
SEARCHING AND SORTING ALGORITHMS
SEARCHING AND SORTING ALGORITHMSSEARCHING AND SORTING ALGORITHMS
SEARCHING AND SORTING ALGORITHMS
 
2-3 Tree
2-3 Tree2-3 Tree
2-3 Tree
 
Graph Data Structure
Graph Data StructureGraph Data Structure
Graph Data Structure
 
Hashing
HashingHashing
Hashing
 
Array implementation and linked list as datat structure
Array implementation and linked list as datat structureArray implementation and linked list as datat structure
Array implementation and linked list as datat structure
 
Decoders
DecodersDecoders
Decoders
 
Selection sorting
Selection sortingSelection sorting
Selection sorting
 
Binary tree
Binary  treeBinary  tree
Binary tree
 
Binary search trees
Binary search treesBinary search trees
Binary search trees
 
Graphs In Data Structure
Graphs In Data StructureGraphs In Data Structure
Graphs In Data Structure
 
MULTIPLEXER
MULTIPLEXERMULTIPLEXER
MULTIPLEXER
 
Data structures
Data structuresData structures
Data structures
 
Queue in Data Structure
Queue in Data Structure Queue in Data Structure
Queue in Data Structure
 
Binary Tree Traversal
Binary Tree TraversalBinary Tree Traversal
Binary Tree Traversal
 
Python
PythonPython
Python
 
Hash tables
Hash tablesHash tables
Hash tables
 
Bitcoin powerpoint
Bitcoin powerpointBitcoin powerpoint
Bitcoin powerpoint
 
Binary Search Tree
Binary Search TreeBinary Search Tree
Binary Search Tree
 

Mehr von Wilfred Springer (13)

Unfiltered Unveiled
Unfiltered UnveiledUnfiltered Unveiled
Unfiltered Unveiled
 
Scala in your organisation
Scala in your organisationScala in your organisation
Scala in your organisation
 
Simplicity
SimplicitySimplicity
Simplicity
 
Unfiltered Unveiled
Unfiltered UnveiledUnfiltered Unveiled
Unfiltered Unveiled
 
Mongo
MongoMongo
Mongo
 
NoSQL
NoSQLNoSQL
NoSQL
 
NoSQL Rollercoaster
NoSQL RollercoasterNoSQL Rollercoaster
NoSQL Rollercoaster
 
Byzantine Generals
Byzantine GeneralsByzantine Generals
Byzantine Generals
 
Into the Wild
Into the WildInto the Wild
Into the Wild
 
OOPSLA Talk on Preon
OOPSLA Talk on PreonOOPSLA Talk on Preon
OOPSLA Talk on Preon
 
Spring ME JavaOne
Spring ME JavaOneSpring ME JavaOne
Spring ME JavaOne
 
Spring ME
Spring MESpring ME
Spring ME
 
Preon (J-Fall 2008)
Preon (J-Fall 2008)Preon (J-Fall 2008)
Preon (J-Fall 2008)
 

Kürzlich hochgeladen

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Kürzlich hochgeladen (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
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
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
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...
 
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...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
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)
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 

Eventually Consistent

  • 1. Eventually Consistent wspringer@xebia.com woensdag 21 juli 2010
  • 2. Werner Vogels woensdag 21 juli 2010
  • 3. ‘60s ‘90s Distribution Minimize Transparency Failure woensdag 21 juli 2010
  • 4. Client Perspective woensdag 21 juli 2010
  • 5. Model B A C woensdag 21 juli 2010
  • 6. Strong Consistency 1 0 value = "foo" value = "bar" 2 B A value = "bar" 2 C 2 value = "bar" value = "bar" After the update, any subsequent access will return the updated value. woensdag 21 juli 2010
  • 7. Weak Consistency B 0 value = "foo" >1 1 value = "bar" A value = "bar" / "foo" >1 C value = "bar" / value = "bar" / "foo" >1 "foo" The system does not guarantee that at any given point in the future subsequent access will return the updated value woensdag 21 juli 2010
  • 8. Eventual Consistency B 0 value = "foo" 1 value = "bar" t A value = "bar" t C value = "bar" t value = "bar" t≥1 If no updates are made to the object, eventually all accesses will return the last updated value. woensdag 21 juli 2010
  • 9. Causal Consistency 2 notification of update B 0 value = "foo" 1 value = "bar" 3 A value = "bar" 3 C value = "foo" Subsequent access by process B will return the updated value, and a write is guaranteed to supersede the earlier write. woensdag 21 juli 2010
  • 10. Read-your-writes Consistency B 0 value = "foo" 1 value = "bar" A C 2 value = "bar" Process A, after updating a data item always access the updated value and never sees an older value woensdag 21 juli 2010
  • 11. Session Consistency B Session 1 0 value = "foo" 1 value = "bar" A 2 value = "bar" 2 value = "foo" C Session 2 Within the “session”, the system guarantees read-your- writes consistency woensdag 21 juli 2010
  • 12. Monotonic Read Consistency B 0 value = "foo" value = "bar" A 3 1 value = "foo" C 2 value = "foo" 4 value = "bar" If a process has seen a particular value for the object, any subsequent access will never return any previous values woensdag 21 juli 2010
  • 13. Monotonic Write Consistency B 0 value = "foo" A value = "bar" 1 2 C value = "last" The system guarantees to serialize the writes by the same process woensdag 21 juli 2010
  • 14. Eventual Consistentency in RDBMS Log shipping Primary Backup replica A 1 async 2 3 Eventual consistency is not just a property of NoSQL Solutions woensdag 21 juli 2010
  • 15. Server Perspective woensdag 21 juli 2010
  • 16. NRW N The number of nodes that store replicates of the data W The number of replicas that need to acknowledge the receipt of the update before the update completes R The number of replicas that are contacted when a data object is accessed through a read operation woensdag 21 juli 2010
  • 17. Strong Consistency W=3 value = "foo" value = "foo" A value = "foo" N=4 value = "foo" R=2 W + R > N implies strong consistency woensdag 21 juli 2010
  • 18. Optimizations • Optimize read: R = 1, N = W • Optimize write: W = 1, N = R woensdag 21 juli 2010
  • 19. Design Considerations • Clients implementing read-your-writes and monotonic reads, by adding versions on writes, and discarding everything the precedes the last-seen version. woensdag 21 juli 2010