SlideShare uma empresa Scribd logo
1 de 37
EEDC
                        34330
Execution
                                The CAP theorem in
Environments for
                                      depth
Distributed
Computing
Erasmus Mundus Distributed
Computing - EMDC


                                  Homework: Final Project
                                  Group number: EEDC-7.1
                                      Group member:
                                     Ioanna Tsalouchidou –
                                 ioannatsalouchidou@gmail.com
Contents


    The Theorem

    The CAP theorem's growing impact

    CAP twelve years later: how the “Rules” have changed

    Perspectives on the CAP theorem

    Consistency tradeoffs in modern distributed database
    system design

    CAP and cloud data management

    Overcoming CAP with consistent soft-state replication

    Conclusions


                            2
The Theorem

Consistency: each server gives the correct response
  to each request


Availability: each request eventually receives a
  response


Partition tolerance: refers to the underlying system
  and not to the service. Servers partitioned to groups
  that are not able to communicate


                            3
The Theorem

“ There is a fundamental tradeoff between consistency,
   availability and network partition tolerance”
                                            Eric Brewer

“ The impossibility of guaranteeing both safety and
   liveness in an unreliable system”



“Fast, Cheap, Good - Pick Any Two”
                                     J. Noel Chiappa

                           4
The Theorem




              5
The Theorem


In practice CAP takes place during a timeout.

Then a decision should be made:

            •   Cancel the operation and thus decrease availability

            •   Continue the operation and be prone to
                inconsistency




                                6
The CAP theorem's growing impact

The big data challenge:

   Handling exponential growth in Web-data

   Relational DBMS with ACID properties do not scale well

   Alternative solutions → NoSQL databases

   Non-relational and distributed databases




                                7
The CAP theorem's growing impact
NoSQL Data Bases:

          •   Flexible schema

          •   Scale horizontally

          •   Do NOT support ACID properties

          •   Store and Replicate data in distributed systems

          •   Achieve Scalability and Reliability




                             8
The CAP theorem's growing impact

Atomicity
                       Consistency
Consistency
               Vs.     Availability
Isolation
                       Partition tolerance
Durability

                  9
The CAP theorem's growing impact

Within a datacenter:

            •   Network failures are rare
            •   No tradeoff between Consistency and
                Availability


Cloud providers:

            •   Maintain multiple datacenters
            •   Datacenters are geographically separated
            •   Consistency- Availability tradeoff appears




                               10
CAP: twelve years later

How “Rules ” have changed:



“Any networked shared-data system can have only two
  of three desirable properties. However, by explicitly
  handling partitions, designers can optimize
  consistency and availability, thereby achieving some
  tradeoff off all three. ”
                                          Eric Brewer




                           11
CAP: twelve years later
Use and Abuse of CAP theorem:

  “2 of 3 ” oversimplifies the tensions among properties.
  CAP → prohibits a tiny part of the design space.
  Perfect availability and Consistency given partitions, which are rare.


Modern CAP:

  Max the combination of Consistency and Availability when possible.
  Operation during a partition.
  Recovery after the partition.
  CAP goes beyond its limitations.

                                  12
CAP: twelve years later
Managing Partitions:

   Detect the start of the partition.
   Partition mode → limited operations.
   Partition recovery.




                               13
CAP: twelve years later
During partition mode:
  The operations to be limited depends on the invariants
     needed to be maintained
Recovery:
  Both sides should become consistent
  Compensation of the mistakes happened during partition
Compensation:
  Tracking and limitation of partition-mode operations.
  Knowledge of the invariants violated.
  Last writer wins.
  Still an open problem.

                           14
Perspectives on the CAP theorem



“ The CAP theorem is one example of a more general
   tradeoff between safety and liveness”

                              Gilbert and Lynch




                         15
Perspectives on the CAP theorem

Safety property → at every point in every execution this
  property holds – Consistency.

Liveness property → if the execution continues for long
  then something desirable happens – Availability.

CAP → any protocol implementing an atomic read/write
  register cannot guarantee both safety and liveness in
  a partition-prone system.




                           16
Perspectives on the CAP theorem
Agreement:
             •   Fault-tolerant agreement is impossible in an
                 asynchronous system.


Requirements for Consensus:
             •   Agreement: all processes same value (safety).
             •   Validity: output-values have been provided as the input of
                 some processes (safety).
             •   Termination: all processes must output a value
                 (liveness).


Consensus:
             •   Safety and liveness are impossible if the system is
                 potentially faulty


                                 17
Perspectives on the CAP theorem
Safety/liveness tradeoff for consensus

   Under which circumstances can we have both?

   Network synchrony
              •   Wholly synchronous network → wholly avoided tradeoff
              •   Cynthia Dwork → eventual synchrony
              •   Tushar Chandra → failure detectors


   Consistency
              •   Maximum level of consistency?
              •   Soma Chaudhuri → set agreement
              •   1-set agreement means consensus no crash failure
              •   t failures need [t/k] +1 rounds and achieve k-set
                  agreement.
                                 18
Perspectives on the CAP theorem
Practical Implications

   Over an unreliable system you can choose to sacrifice

              •   Availability

              •   Consistency

              •   Moderate approach – sacrifice both dynamically
                     – Well response to most user requests
                     – Consistency when it is necessary




                                 19
Perspectives on the CAP theorem
Best-effort availability

      – Most common approach

      – Guarantees consistency, regardless of network behavior

      – When communication is typically reliable

      – Example of servers of the same datacenter – rare partitions




                                20
Perspectives on the CAP theorem
Best-effort consistency

      – Sometimes unavailability is not an option

      – Inconsistency is not a major problem

      – Web caches, services with image and video content

      – Best-effort for up-to-date data

      – No assurance that all users get the same content

      – Not high requirement of strong consistency

                                 21
Perspectives on the CAP theorem
Balancing consistency and availability

   Neither strong consistency nor continual availability.
   Applications specify the level of continuous consistency.

   Airline reservation system
              •   Many free seats → sacrifice consistency
              •   A few places left → sacrifice availability


   Inconsistency of data when consistency is not needed.
   Unavailability when major network partition happens.

   → Increase system's robustness to network disruption before
    sacrificing availability.
                                  22
Tradeoffs in modern distributed db




“ The CAP theorem's impact on modern DDBS is more
   limited than is often perceived”
                                    Caniel J. Abadi




                         23
Tradeoffs in modern distributed db




“It is wrong to assume that DDBSs that reduce
   consistency in the absence of any partitions are
   doing so due to CAP-based decision-making”




                           24
Tradeoffs in modern distributed db
Consistency/ Latency tradeoff:
            •   Availability ~ Latency
            •   An unavailable system provides extreme latency
            •   Exists even without network partitions
            •   System runs long enough → at least one component fails
            •   Highly available systems need to replicate data


The occurrence of failure causes CAP tradeoffs, the
  possibility of failure results in Consistency/Latency
  tradeoff.




                               25
Tradeoffs in modern distributed db
Data Replication:

   As soon as a DDBS replicates data, a tradeoff between consistency
     and latency arises.

   Replication alternatives
               •   Data updates to all replicas at the same time.
               •   Data updates first to an agreed master node.
               •   Data updates to a single arbitrary node.


   Each implementation comes with consistency/latency tradeoff.




                                   26
Tradeoffs in modern distributed db

                                     PACELC



If there is a Partition, how does the system trade off
    Availability and Consistency; Else, when a system is
    running normally in the absence of partitions, how
    does the system trade off Latency and Consistency?



                           27
CAP and cloud data management

Web applications must scale on demand.

Need for requests with low latency

Require high throughput

Highly available

Minimum operational cost



                           28
CAP and cloud data management
Coordinating all updates through a master

Performance and availability implications

PNUTS → automatically migrating the master to be
  close to the writers

Impact on performance and availability insignificant for
  Yahoo's applications
            • Localized user access patterns




                                29
Overcoming CAP: replication

Stronger consistency inside the datacenter

Low latency

Scalability

No consistency sacrificing




                             30
Overcoming CAP: replication

First-tier cloud services:

   New consistency model for data replication.


   Combination of agreement on update ordering with amnesia
     freedom.


   → Surprising levels of scalability and performance.




                                  31
Overcoming CAP: replication
The ISIS system
  
      Supports virtually synchronous process groups
  
      Reliable multicast
  
      Various ordering options
  
      Send primitive is FIFO-ordered
  
      Ordered-primitive guarantees total order
  
      Barrier primitive Flush → Amnesia Freedom
              
                  Delay until prior unstable multicasts reached destinations
  
      Virtually synchronous version of Paxos
  
      SafeSend
              
                  In-memory durability
              
                  On-disk durability




                                  32
Overcoming CAP: replication




                  33
Conclusions
CAP → “2 of 3” in unreliable systems - No blind sacrifice
  consistency or availability when partitions exist.

Safety/ Liveness

Failures → CAP tradeoffs,
possibility of failure → Consistency/Latency tradeoff.

Replication

PACELC


                              34
References
[1] Guest Editor's Introduction: The CAP Theorem's Growing Impact -
    http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=6155651


[2] Pushing the CAP: Strategies for Consistency and Availability -
    http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=6133253


[3] Perspectives on the CAP Theorem -
    http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=6122006


[4] Consistency Tradeoffs in Modern Distributed Database System Design:
    CAP is Only Part of the Story -
    http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=6127847


[5] CAP and Cloud Data Management -
    http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=6122007


                                  35
References
[6] Overcoming CAP with Consistent Soft-State Replication -
   http://ieeexplore.ieee.org/stamp/stamp.jsp?
   tp=&arnumber=6112739


[7] http://en.wikipedia.org/wiki/CAP_theorem


[8] http://nathanmarz.com/blog/how-to-beat-the-cap-theorem.html


[9] http://www.cloudera.com/blog/2010/04/cap-confusion-
   problems-with-partition-tolerance/


[10] http://wiki.fib.upc.es/sds/images/8/89/02-visions.pdf




                                 36
EEDC
                        34330
Execution
                                The CAP theorem in
Environments for
                                      depth
Distributed
Computing
Erasmus Mundus Distributed
Computing - EMDC


                                  Homework: Final Project
                                  Group number: EEDC-7.1
                                      Group member:
                                     Ioanna Tsalouchidou –
                                 ioannatsalouchidou@gmail.com

Mais conteúdo relacionado

Mais procurados

The Era of MicroServers
The Era of MicroServersThe Era of MicroServers
The Era of MicroServersPaul Morse
 
A Low Control Overhead Cluster Maintenance Scheme for Mobile Ad hoc NETworks ...
A Low Control Overhead Cluster Maintenance Scheme for Mobile Ad hoc NETworks ...A Low Control Overhead Cluster Maintenance Scheme for Mobile Ad hoc NETworks ...
A Low Control Overhead Cluster Maintenance Scheme for Mobile Ad hoc NETworks ...IDES Editor
 
Understanding the Cloud Computing Stack
Understanding the Cloud Computing StackUnderstanding the Cloud Computing Stack
Understanding the Cloud Computing StackRackspace
 
Migration of Virtual Machine to improve the Security in Cloud Computing
Migration of Virtual Machine to improve the Security in Cloud Computing Migration of Virtual Machine to improve the Security in Cloud Computing
Migration of Virtual Machine to improve the Security in Cloud Computing IJECEIAES
 
Einstein Albert and Hawking Stephen - The Relativity Of The Big Time (1921)
Einstein Albert and Hawking Stephen - The Relativity Of The Big Time (1921)Einstein Albert and Hawking Stephen - The Relativity Of The Big Time (1921)
Einstein Albert and Hawking Stephen - The Relativity Of The Big Time (1921)guest57c9b2
 
From Mainframe to Microservice: An Introduction to Distributed Systems
From Mainframe to Microservice: An Introduction to Distributed SystemsFrom Mainframe to Microservice: An Introduction to Distributed Systems
From Mainframe to Microservice: An Introduction to Distributed SystemsTyler Treat
 

Mais procurados (9)

Cloud computing
Cloud computingCloud computing
Cloud computing
 
techcodes
techcodestechcodes
techcodes
 
The Era of MicroServers
The Era of MicroServersThe Era of MicroServers
The Era of MicroServers
 
Cloudcpmuting journal
Cloudcpmuting journalCloudcpmuting journal
Cloudcpmuting journal
 
A Low Control Overhead Cluster Maintenance Scheme for Mobile Ad hoc NETworks ...
A Low Control Overhead Cluster Maintenance Scheme for Mobile Ad hoc NETworks ...A Low Control Overhead Cluster Maintenance Scheme for Mobile Ad hoc NETworks ...
A Low Control Overhead Cluster Maintenance Scheme for Mobile Ad hoc NETworks ...
 
Understanding the Cloud Computing Stack
Understanding the Cloud Computing StackUnderstanding the Cloud Computing Stack
Understanding the Cloud Computing Stack
 
Migration of Virtual Machine to improve the Security in Cloud Computing
Migration of Virtual Machine to improve the Security in Cloud Computing Migration of Virtual Machine to improve the Security in Cloud Computing
Migration of Virtual Machine to improve the Security in Cloud Computing
 
Einstein Albert and Hawking Stephen - The Relativity Of The Big Time (1921)
Einstein Albert and Hawking Stephen - The Relativity Of The Big Time (1921)Einstein Albert and Hawking Stephen - The Relativity Of The Big Time (1921)
Einstein Albert and Hawking Stephen - The Relativity Of The Big Time (1921)
 
From Mainframe to Microservice: An Introduction to Distributed Systems
From Mainframe to Microservice: An Introduction to Distributed SystemsFrom Mainframe to Microservice: An Introduction to Distributed Systems
From Mainframe to Microservice: An Introduction to Distributed Systems
 

Destaque

All you didn't know about the CAP theorem
All you didn't know about the CAP theoremAll you didn't know about the CAP theorem
All you didn't know about the CAP theoremKanstantsin Hontarau
 
NoSQL in Perspective
NoSQL in PerspectiveNoSQL in Perspective
NoSQL in PerspectiveJeff Smith
 
Azure DocumentDB Overview
Azure DocumentDB OverviewAzure DocumentDB Overview
Azure DocumentDB OverviewAndrew Liu
 
Anything Data: Big, Streaming, NoSQL, Cloud, Science ... A Sloppy Travel Guide
Anything Data: Big, Streaming, NoSQL, Cloud, Science ... A Sloppy Travel GuideAnything Data: Big, Streaming, NoSQL, Cloud, Science ... A Sloppy Travel Guide
Anything Data: Big, Streaming, NoSQL, Cloud, Science ... A Sloppy Travel GuideAhmet Akyol
 
CAP, PACELC, and Determinism
CAP, PACELC, and DeterminismCAP, PACELC, and Determinism
CAP, PACELC, and DeterminismDaniel Abadi
 
NoSQL Databases: Why, what and when
NoSQL Databases: Why, what and whenNoSQL Databases: Why, what and when
NoSQL Databases: Why, what and whenLorenzo Alberton
 

Destaque (6)

All you didn't know about the CAP theorem
All you didn't know about the CAP theoremAll you didn't know about the CAP theorem
All you didn't know about the CAP theorem
 
NoSQL in Perspective
NoSQL in PerspectiveNoSQL in Perspective
NoSQL in Perspective
 
Azure DocumentDB Overview
Azure DocumentDB OverviewAzure DocumentDB Overview
Azure DocumentDB Overview
 
Anything Data: Big, Streaming, NoSQL, Cloud, Science ... A Sloppy Travel Guide
Anything Data: Big, Streaming, NoSQL, Cloud, Science ... A Sloppy Travel GuideAnything Data: Big, Streaming, NoSQL, Cloud, Science ... A Sloppy Travel Guide
Anything Data: Big, Streaming, NoSQL, Cloud, Science ... A Sloppy Travel Guide
 
CAP, PACELC, and Determinism
CAP, PACELC, and DeterminismCAP, PACELC, and Determinism
CAP, PACELC, and Determinism
 
NoSQL Databases: Why, what and when
NoSQL Databases: Why, what and whenNoSQL Databases: Why, what and when
NoSQL Databases: Why, what and when
 

Semelhante a Cap in depth

CAP Theorem and Split Brain Syndrome
CAP Theorem and Split Brain SyndromeCAP Theorem and Split Brain Syndrome
CAP Theorem and Split Brain SyndromeDilum Bandara
 
CAP Theorem - Theory, Implications and Practices
CAP Theorem - Theory, Implications and PracticesCAP Theorem - Theory, Implications and Practices
CAP Theorem - Theory, Implications and PracticesYoav Francis
 
Beyond Strong Consistency
Beyond Strong ConsistencyBeyond Strong Consistency
Beyond Strong Consistencyjsinglet
 
Provably Secure Key-Aggregate Cryptosystems with Broadcast Aggregate Keys for...
Provably Secure Key-Aggregate Cryptosystems with Broadcast Aggregate Keys for...Provably Secure Key-Aggregate Cryptosystems with Broadcast Aggregate Keys for...
Provably Secure Key-Aggregate Cryptosystems with Broadcast Aggregate Keys for...Prasadu Peddi
 
Reactive Revealed Part 2: Scalability, Elasticity and Location Transparency i...
Reactive Revealed Part 2: Scalability, Elasticity and Location Transparency i...Reactive Revealed Part 2: Scalability, Elasticity and Location Transparency i...
Reactive Revealed Part 2: Scalability, Elasticity and Location Transparency i...Legacy Typesafe (now Lightbend)
 
cse40822-CAP.pptx
cse40822-CAP.pptxcse40822-CAP.pptx
cse40822-CAP.pptxNedaaHamed1
 
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 theoremVishal Bardoloi
 
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 Kleppmannmustafa sarac
 
Migrating from Java EE to cloud-native Reactive systems
Migrating from Java EE to cloud-native Reactive systemsMigrating from Java EE to cloud-native Reactive systems
Migrating from Java EE to cloud-native Reactive systemsMarkus Eisele
 
Migrating From Java EE To Cloud-Native Reactive Systems
Migrating From Java EE To Cloud-Native Reactive SystemsMigrating From Java EE To Cloud-Native Reactive Systems
Migrating From Java EE To Cloud-Native Reactive SystemsLightbend
 
Consistency in Distributed Systems, Part 2
Consistency in Distributed Systems, Part 2Consistency in Distributed Systems, Part 2
Consistency in Distributed Systems, Part 2DATAVERSITY
 
NoSQL Database
NoSQL DatabaseNoSQL Database
NoSQL DatabaseSteve Min
 
Chapter Introductionn to distributed system .pptx
Chapter Introductionn to distributed system .pptxChapter Introductionn to distributed system .pptx
Chapter Introductionn to distributed system .pptxTekle12
 
Distributed computing for new bloods
Distributed computing for new bloodsDistributed computing for new bloods
Distributed computing for new bloodsRaymond Tay
 
Managing Dynamic Shared state
Managing Dynamic Shared stateManaging Dynamic Shared state
Managing Dynamic Shared stateAditya Gupta
 

Semelhante a Cap in depth (20)

CAP Theorem and Split Brain Syndrome
CAP Theorem and Split Brain SyndromeCAP Theorem and Split Brain Syndrome
CAP Theorem and Split Brain Syndrome
 
CAP Theorem - Theory, Implications and Practices
CAP Theorem - Theory, Implications and PracticesCAP Theorem - Theory, Implications and Practices
CAP Theorem - Theory, Implications and Practices
 
Introduction
IntroductionIntroduction
Introduction
 
ds7_con.ppt
ds7_con.pptds7_con.ppt
ds7_con.ppt
 
Beyond Strong Consistency
Beyond Strong ConsistencyBeyond Strong Consistency
Beyond Strong Consistency
 
Provably Secure Key-Aggregate Cryptosystems with Broadcast Aggregate Keys for...
Provably Secure Key-Aggregate Cryptosystems with Broadcast Aggregate Keys for...Provably Secure Key-Aggregate Cryptosystems with Broadcast Aggregate Keys for...
Provably Secure Key-Aggregate Cryptosystems with Broadcast Aggregate Keys for...
 
Reactive Revealed Part 2: Scalability, Elasticity and Location Transparency i...
Reactive Revealed Part 2: Scalability, Elasticity and Location Transparency i...Reactive Revealed Part 2: Scalability, Elasticity and Location Transparency i...
Reactive Revealed Part 2: Scalability, Elasticity and Location Transparency i...
 
cse40822-CAP.pptx
cse40822-CAP.pptxcse40822-CAP.pptx
cse40822-CAP.pptx
 
Hbase hive pig
Hbase hive pigHbase hive pig
Hbase hive pig
 
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
 
Tugas 5 0317
Tugas 5 0317Tugas 5 0317
Tugas 5 0317
 
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
 
Migrating from Java EE to cloud-native Reactive systems
Migrating from Java EE to cloud-native Reactive systemsMigrating from Java EE to cloud-native Reactive systems
Migrating from Java EE to cloud-native Reactive systems
 
Migrating From Java EE To Cloud-Native Reactive Systems
Migrating From Java EE To Cloud-Native Reactive SystemsMigrating From Java EE To Cloud-Native Reactive Systems
Migrating From Java EE To Cloud-Native Reactive Systems
 
Consistency in Distributed Systems, Part 2
Consistency in Distributed Systems, Part 2Consistency in Distributed Systems, Part 2
Consistency in Distributed Systems, Part 2
 
NoSQL Database
NoSQL DatabaseNoSQL Database
NoSQL Database
 
Chapter Introductionn to distributed system .pptx
Chapter Introductionn to distributed system .pptxChapter Introductionn to distributed system .pptx
Chapter Introductionn to distributed system .pptx
 
Ha
HaHa
Ha
 
Distributed computing for new bloods
Distributed computing for new bloodsDistributed computing for new bloods
Distributed computing for new bloods
 
Managing Dynamic Shared state
Managing Dynamic Shared stateManaging Dynamic Shared state
Managing Dynamic Shared state
 

Mais de Ioanna Tsalouchidou

Scalable Dynamic Graph Summarization
Scalable Dynamic Graph SummarizationScalable Dynamic Graph Summarization
Scalable Dynamic Graph SummarizationIoanna Tsalouchidou
 
A Distributed Self-management Service
A Distributed Self-management ServiceA Distributed Self-management Service
A Distributed Self-management ServiceIoanna Tsalouchidou
 
Observation, Experiment, Conclusion: the Three Princes of Serendip_essay_Phil...
Observation, Experiment, Conclusion: the Three Princes of Serendip_essay_Phil...Observation, Experiment, Conclusion: the Three Princes of Serendip_essay_Phil...
Observation, Experiment, Conclusion: the Three Princes of Serendip_essay_Phil...Ioanna Tsalouchidou
 
The Chubby lock service for loosely- coupled distributed systems
The Chubby lock service for loosely- coupled distributed systems The Chubby lock service for loosely- coupled distributed systems
The Chubby lock service for loosely- coupled distributed systems Ioanna Tsalouchidou
 
7.howcompanieslearnyoursecrets 120318193259-phpapp01
7.howcompanieslearnyoursecrets 120318193259-phpapp017.howcompanieslearnyoursecrets 120318193259-phpapp01
7.howcompanieslearnyoursecrets 120318193259-phpapp01Ioanna Tsalouchidou
 
Simulation vs experimental-testbeds_ioanna_tsalouchidou
Simulation vs experimental-testbeds_ioanna_tsalouchidouSimulation vs experimental-testbeds_ioanna_tsalouchidou
Simulation vs experimental-testbeds_ioanna_tsalouchidouIoanna Tsalouchidou
 
Intelligent placement of_datacenters_for_internet_services_ioanna_tsalouchidou
Intelligent placement of_datacenters_for_internet_services_ioanna_tsalouchidouIntelligent placement of_datacenters_for_internet_services_ioanna_tsalouchidou
Intelligent placement of_datacenters_for_internet_services_ioanna_tsalouchidouIoanna Tsalouchidou
 

Mais de Ioanna Tsalouchidou (8)

Scalable Dynamic Graph Summarization
Scalable Dynamic Graph SummarizationScalable Dynamic Graph Summarization
Scalable Dynamic Graph Summarization
 
A Distributed Self-management Service
A Distributed Self-management ServiceA Distributed Self-management Service
A Distributed Self-management Service
 
Observation, Experiment, Conclusion: the Three Princes of Serendip_essay_Phil...
Observation, Experiment, Conclusion: the Three Princes of Serendip_essay_Phil...Observation, Experiment, Conclusion: the Three Princes of Serendip_essay_Phil...
Observation, Experiment, Conclusion: the Three Princes of Serendip_essay_Phil...
 
The Chubby lock service for loosely- coupled distributed systems
The Chubby lock service for loosely- coupled distributed systems The Chubby lock service for loosely- coupled distributed systems
The Chubby lock service for loosely- coupled distributed systems
 
7.howcompanieslearnyoursecrets 120318193259-phpapp01
7.howcompanieslearnyoursecrets 120318193259-phpapp017.howcompanieslearnyoursecrets 120318193259-phpapp01
7.howcompanieslearnyoursecrets 120318193259-phpapp01
 
Simulation vs experimental-testbeds_ioanna_tsalouchidou
Simulation vs experimental-testbeds_ioanna_tsalouchidouSimulation vs experimental-testbeds_ioanna_tsalouchidou
Simulation vs experimental-testbeds_ioanna_tsalouchidou
 
Intelligent placement of_datacenters_for_internet_services_ioanna_tsalouchidou
Intelligent placement of_datacenters_for_internet_services_ioanna_tsalouchidouIntelligent placement of_datacenters_for_internet_services_ioanna_tsalouchidou
Intelligent placement of_datacenters_for_internet_services_ioanna_tsalouchidou
 
Rest vs soap
Rest vs soapRest vs soap
Rest vs soap
 

Cap in depth

  • 1. EEDC 34330 Execution The CAP theorem in Environments for depth Distributed Computing Erasmus Mundus Distributed Computing - EMDC Homework: Final Project Group number: EEDC-7.1 Group member: Ioanna Tsalouchidou – ioannatsalouchidou@gmail.com
  • 2. Contents  The Theorem  The CAP theorem's growing impact  CAP twelve years later: how the “Rules” have changed  Perspectives on the CAP theorem  Consistency tradeoffs in modern distributed database system design  CAP and cloud data management  Overcoming CAP with consistent soft-state replication  Conclusions 2
  • 3. The Theorem Consistency: each server gives the correct response to each request Availability: each request eventually receives a response Partition tolerance: refers to the underlying system and not to the service. Servers partitioned to groups that are not able to communicate 3
  • 4. The Theorem “ There is a fundamental tradeoff between consistency, availability and network partition tolerance” Eric Brewer “ The impossibility of guaranteeing both safety and liveness in an unreliable system” “Fast, Cheap, Good - Pick Any Two” J. Noel Chiappa 4
  • 6. The Theorem In practice CAP takes place during a timeout. Then a decision should be made: • Cancel the operation and thus decrease availability • Continue the operation and be prone to inconsistency 6
  • 7. The CAP theorem's growing impact The big data challenge: Handling exponential growth in Web-data Relational DBMS with ACID properties do not scale well Alternative solutions → NoSQL databases Non-relational and distributed databases 7
  • 8. The CAP theorem's growing impact NoSQL Data Bases: • Flexible schema • Scale horizontally • Do NOT support ACID properties • Store and Replicate data in distributed systems • Achieve Scalability and Reliability 8
  • 9. The CAP theorem's growing impact Atomicity Consistency Consistency Vs. Availability Isolation Partition tolerance Durability 9
  • 10. The CAP theorem's growing impact Within a datacenter: • Network failures are rare • No tradeoff between Consistency and Availability Cloud providers: • Maintain multiple datacenters • Datacenters are geographically separated • Consistency- Availability tradeoff appears 10
  • 11. CAP: twelve years later How “Rules ” have changed: “Any networked shared-data system can have only two of three desirable properties. However, by explicitly handling partitions, designers can optimize consistency and availability, thereby achieving some tradeoff off all three. ” Eric Brewer 11
  • 12. CAP: twelve years later Use and Abuse of CAP theorem: “2 of 3 ” oversimplifies the tensions among properties. CAP → prohibits a tiny part of the design space. Perfect availability and Consistency given partitions, which are rare. Modern CAP: Max the combination of Consistency and Availability when possible. Operation during a partition. Recovery after the partition. CAP goes beyond its limitations. 12
  • 13. CAP: twelve years later Managing Partitions: Detect the start of the partition. Partition mode → limited operations. Partition recovery. 13
  • 14. CAP: twelve years later During partition mode: The operations to be limited depends on the invariants needed to be maintained Recovery: Both sides should become consistent Compensation of the mistakes happened during partition Compensation: Tracking and limitation of partition-mode operations. Knowledge of the invariants violated. Last writer wins. Still an open problem. 14
  • 15. Perspectives on the CAP theorem “ The CAP theorem is one example of a more general tradeoff between safety and liveness” Gilbert and Lynch 15
  • 16. Perspectives on the CAP theorem Safety property → at every point in every execution this property holds – Consistency. Liveness property → if the execution continues for long then something desirable happens – Availability. CAP → any protocol implementing an atomic read/write register cannot guarantee both safety and liveness in a partition-prone system. 16
  • 17. Perspectives on the CAP theorem Agreement: • Fault-tolerant agreement is impossible in an asynchronous system. Requirements for Consensus: • Agreement: all processes same value (safety). • Validity: output-values have been provided as the input of some processes (safety). • Termination: all processes must output a value (liveness). Consensus: • Safety and liveness are impossible if the system is potentially faulty 17
  • 18. Perspectives on the CAP theorem Safety/liveness tradeoff for consensus Under which circumstances can we have both? Network synchrony • Wholly synchronous network → wholly avoided tradeoff • Cynthia Dwork → eventual synchrony • Tushar Chandra → failure detectors Consistency • Maximum level of consistency? • Soma Chaudhuri → set agreement • 1-set agreement means consensus no crash failure • t failures need [t/k] +1 rounds and achieve k-set agreement. 18
  • 19. Perspectives on the CAP theorem Practical Implications Over an unreliable system you can choose to sacrifice • Availability • Consistency • Moderate approach – sacrifice both dynamically – Well response to most user requests – Consistency when it is necessary 19
  • 20. Perspectives on the CAP theorem Best-effort availability – Most common approach – Guarantees consistency, regardless of network behavior – When communication is typically reliable – Example of servers of the same datacenter – rare partitions 20
  • 21. Perspectives on the CAP theorem Best-effort consistency – Sometimes unavailability is not an option – Inconsistency is not a major problem – Web caches, services with image and video content – Best-effort for up-to-date data – No assurance that all users get the same content – Not high requirement of strong consistency 21
  • 22. Perspectives on the CAP theorem Balancing consistency and availability Neither strong consistency nor continual availability. Applications specify the level of continuous consistency. Airline reservation system • Many free seats → sacrifice consistency • A few places left → sacrifice availability Inconsistency of data when consistency is not needed. Unavailability when major network partition happens. → Increase system's robustness to network disruption before sacrificing availability. 22
  • 23. Tradeoffs in modern distributed db “ The CAP theorem's impact on modern DDBS is more limited than is often perceived” Caniel J. Abadi 23
  • 24. Tradeoffs in modern distributed db “It is wrong to assume that DDBSs that reduce consistency in the absence of any partitions are doing so due to CAP-based decision-making” 24
  • 25. Tradeoffs in modern distributed db Consistency/ Latency tradeoff: • Availability ~ Latency • An unavailable system provides extreme latency • Exists even without network partitions • System runs long enough → at least one component fails • Highly available systems need to replicate data The occurrence of failure causes CAP tradeoffs, the possibility of failure results in Consistency/Latency tradeoff. 25
  • 26. Tradeoffs in modern distributed db Data Replication: As soon as a DDBS replicates data, a tradeoff between consistency and latency arises. Replication alternatives • Data updates to all replicas at the same time. • Data updates first to an agreed master node. • Data updates to a single arbitrary node. Each implementation comes with consistency/latency tradeoff. 26
  • 27. Tradeoffs in modern distributed db PACELC If there is a Partition, how does the system trade off Availability and Consistency; Else, when a system is running normally in the absence of partitions, how does the system trade off Latency and Consistency? 27
  • 28. CAP and cloud data management Web applications must scale on demand. Need for requests with low latency Require high throughput Highly available Minimum operational cost 28
  • 29. CAP and cloud data management Coordinating all updates through a master Performance and availability implications PNUTS → automatically migrating the master to be close to the writers Impact on performance and availability insignificant for Yahoo's applications • Localized user access patterns 29
  • 30. Overcoming CAP: replication Stronger consistency inside the datacenter Low latency Scalability No consistency sacrificing 30
  • 31. Overcoming CAP: replication First-tier cloud services: New consistency model for data replication. Combination of agreement on update ordering with amnesia freedom. → Surprising levels of scalability and performance. 31
  • 32. Overcoming CAP: replication The ISIS system  Supports virtually synchronous process groups  Reliable multicast  Various ordering options  Send primitive is FIFO-ordered  Ordered-primitive guarantees total order  Barrier primitive Flush → Amnesia Freedom  Delay until prior unstable multicasts reached destinations  Virtually synchronous version of Paxos  SafeSend  In-memory durability  On-disk durability 32
  • 34. Conclusions CAP → “2 of 3” in unreliable systems - No blind sacrifice consistency or availability when partitions exist. Safety/ Liveness Failures → CAP tradeoffs, possibility of failure → Consistency/Latency tradeoff. Replication PACELC 34
  • 35. References [1] Guest Editor's Introduction: The CAP Theorem's Growing Impact - http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=6155651 [2] Pushing the CAP: Strategies for Consistency and Availability - http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=6133253 [3] Perspectives on the CAP Theorem - http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=6122006 [4] Consistency Tradeoffs in Modern Distributed Database System Design: CAP is Only Part of the Story - http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=6127847 [5] CAP and Cloud Data Management - http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=6122007 35
  • 36. References [6] Overcoming CAP with Consistent Soft-State Replication - http://ieeexplore.ieee.org/stamp/stamp.jsp? tp=&arnumber=6112739 [7] http://en.wikipedia.org/wiki/CAP_theorem [8] http://nathanmarz.com/blog/how-to-beat-the-cap-theorem.html [9] http://www.cloudera.com/blog/2010/04/cap-confusion- problems-with-partition-tolerance/ [10] http://wiki.fib.upc.es/sds/images/8/89/02-visions.pdf 36
  • 37. EEDC 34330 Execution The CAP theorem in Environments for depth Distributed Computing Erasmus Mundus Distributed Computing - EMDC Homework: Final Project Group number: EEDC-7.1 Group member: Ioanna Tsalouchidou – ioannatsalouchidou@gmail.com