SlideShare une entreprise Scribd logo
1  sur  19
Télécharger pour lire hors ligne
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

Contenu connexe

Plus de 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)
 

Dernier

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 

Dernier (20)

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 

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