SlideShare a Scribd company logo
1 of 45
Download to read offline
Life After the CAP Theorem
Borémi Toch & Stéphane Lundy
2
Who’s Who ?
@LSrandomBorémi Toch
3
Why are we talking about a theorem ?
4
From Pets to Cattle: Distributed is Becoming The Norm
5
So what’s the goal ?
☉ Understand why the CAP Theorem is
not that practical, but still useful
☉ Give you practical guidelines when
dealing with distributed persistence
☉ Match the system design with the
business stakes
6
From Start...
7
...To Finish
>01 Brewer’s Conjecture
9
What is distributed system ?
A distributed systemNot a distributed system
10
Your guide for the hike: Mr. Eric Brewer
11
You can’t have the whole pie and eat it, Eric Brewer 2000
12
Getting equipped: a tiny bit of theory
13
Consistency (Linearizability)
There must exist a total order on all operations such that each
operation looks as if it were completed at a single instant.
Gilbert, Lynch, 2002
v1 v2 v3
Read ReadWrite(v2) Read=> v3Write(v3)=> v1 => v3
14
Availability
Every request received by a non-failing node in the system must result
in a response.
Gilbert, Lynch, 2002
Client
Request
Response
15
Partition Tolerance
When a network is partitioned, all messages sent from nodes in one component
of the partition to nodes in another component are lost.
Gilbert, Lynch, 2002
Distributed System
16
Partition Tolerance
When a network is partitioned, all messages sent from nodes in one component
of the partition to nodes in another component are lost.
Gilbert, Lynch, 2002
Blue Partition Green Partition
17
The Completely Asynchronous Network Assumption
>02 Brewer’s Refresh
19
2012: Second Take, by Brewer himself
☉ Must read article (available on infoQ)
☉ 12 years of insight into what his original conjecture meant
☉ Easy read with practical examples
20
2015: A Critique of the CAP Theorem, by Martin Kleppmann
☉ Excellent in-depth analysis
☉ Must read to understand the in-depth limitations of the CAP Theorem
☉ Extensive bibliography to dig deeper in the current state of the art
CAP Theorem Dismisses Latency
☉ CAP Theorem ignores latency, even though in practice communications rely on it
☉ Availability and partition state cannot be detected instantaneously
Blue Partition Green Partition
22
No one can actually forfeit Partitions
Consistency and Availability Need Not Be Perfect
☉ The CAP impossibility result holds only for perfect properties
☉ C & A actually range on a spectrum, where tradeoff rules the land
Always return
v0
Return latest
consistent version
Return stale version (vN, N>0)
Eventual Consistency
Super Fragile High Availability
99.999999...
availability
Useless Holy GrailPragmatic Architecture
Consistency
Availability
>03 How To Use It In Practice
25
Easy Peasy Practical Guide
26
Guideline #1: Ask The Partition Question
☉ That’s a system designer question
> Should the system restrict operations ?
> Should the system proceed ?
☉ And a designer question is actually a business decision
What should the system do when a partition occurs ?
27
Guideline #2: Ask The Recovery Question
☉ A system designer has tools to do that, for instance
> Last Writer Wins
> Linearisation
> Compensation
> Human escalation
☉ But in the end that is again a business decision
How should we resolve the partition conflict ?
28
Guideline #0: Don’t Forget That’s Part Of A Risk Analysis
☉ Overdesign lurks on the dark side
☉ System Designers have tools
> KISS: Keep It Simple & Stupid
> Measure, Don’t guess (aka. empiricism, test & learn, short feedback loop…)
☉ What are the risks and impacts ? ask the business people
Is the likelihood worth the complexity ?
29
A nice drawing to clear things up
Time
30
A nice drawing to clear things up
Time
Partition
recovery
Partition
31
Hey but it’s just like
☉ Partition is by design
☉ Merge cannot always be completely
automated
Time
Merge
Local
modifications
>04 Other IT Examples And Patterns
File Synchronization
☉ Partition is by design
☉ Last Writer Wins strategy (LWW) most
of the time
☉ Conflicts are escalated to the user with
file names suffixed with (2), (3)...
Time
Back to base
Offline work
Document Edition
☉ Edition in the browser, with varying
update frequency
☉ Strategies: LWW for whole document
or finer text modifications updates
Time
Merge
Local
modifications
Optimistic Locking
Pessimistic Locking
Relational Databases Management Systems
☉ Pessimistic Locking is about
preventing partitions
☉ Optimistic Locking is about
concurrent editing with a First
Writer Wins strategy
Time
Blockchain Mandatory Mention
☉ Blockchains are decentralised systems
☉ In proof of work systems, the longest
chain, ie. the most powerful alternative
wins
Time
Merge
Uncertainty
>05 Business Already Knows It All
E-commerce: Stock Management
☉ What do you want :
> To check your stock before selling ?
> To sell items as fast as possible ?
☉ What do you need ?
> It depends !
☉ What do you want :
> To check the disponibility of assets ?
> To encourage the cash flow ?
☉ What do you need ?
> It depends !
ATM: Withdrawal or no Withdrawal
☉ What do you want :
> To check users permission ?
> To show the up to date content ?
☉ What do you need ?
> It depends !
Social Media: Timeline Consistency
>06 Wrap-Up
42
So What to Think about the CAP Theorem ?
All models are wrong, but some are useful
George E. P. Box
44
Take Away
☉ Though not practical, the CAP Theorem is not useless
> It helps raise questions about the Consistency-Availability trade-off
> It has fueled many distributed system designs since 2000
☉ Think about Network Partitions when you design systems
> What are the risks ?
> What to do when a partition occurs ?
> What are the rules to recover from a partition ?
☉ You may actually be more familiar with it than you think
> Don’t bicker about being CA, AP, or CP
> You already use some distributed IT tools
☉ Never forget : answers come from the business
45
Initiatives To Keep An Eye On
☉ Conflict-free Replicated Data Types aka. CRDT
> Started with a paper published by Shapiro & al. 2011
> CRDT ensure worry-free partition recovery
> Some products leverage CRDT: Riak, Redis…
☉ Spanner: closing on the CAP impossibility
> Cloud Spanner is a fully managed consistent database
with high availability
> Eric Brewer, now VP of infrastructure at Google has
analysed Spanner in the CAP Theorem perspective
> Leverages Google infrastructure: highly reliable network
& high precision clocks

More Related Content

More from OCTO Technology

Comptoir OCTO ALD Automotive/Leaseplan
Comptoir OCTO ALD Automotive/LeaseplanComptoir OCTO ALD Automotive/Leaseplan
Comptoir OCTO ALD Automotive/LeaseplanOCTO Technology
 
Le Comptoir OCTO - Comment optimiser les stocks en linéaire par la Data ?
Le Comptoir OCTO - Comment optimiser les stocks en linéaire par la Data ? Le Comptoir OCTO - Comment optimiser les stocks en linéaire par la Data ?
Le Comptoir OCTO - Comment optimiser les stocks en linéaire par la Data ? OCTO Technology
 
Le Comptoir OCTO - Retour sur 5 ans de mise en oeuvre : Comment le RGPD a réi...
Le Comptoir OCTO - Retour sur 5 ans de mise en oeuvre : Comment le RGPD a réi...Le Comptoir OCTO - Retour sur 5 ans de mise en oeuvre : Comment le RGPD a réi...
Le Comptoir OCTO - Retour sur 5 ans de mise en oeuvre : Comment le RGPD a réi...OCTO Technology
 
Le Comptoir OCTO - Affinez vos forecasts avec la planification distribuée et...
Le Comptoir OCTO -  Affinez vos forecasts avec la planification distribuée et...Le Comptoir OCTO -  Affinez vos forecasts avec la planification distribuée et...
Le Comptoir OCTO - Affinez vos forecasts avec la planification distribuée et...OCTO Technology
 
Le Comptoir OCTO - La formation au cœur de la stratégie d’éco-conception
Le Comptoir OCTO - La formation au cœur de la stratégie d’éco-conceptionLe Comptoir OCTO - La formation au cœur de la stratégie d’éco-conception
Le Comptoir OCTO - La formation au cœur de la stratégie d’éco-conceptionOCTO Technology
 
Le Comptoir OCTO - Une vision de plateforme sans leadership tech n’est qu’hal...
Le Comptoir OCTO - Une vision de plateforme sans leadership tech n’est qu’hal...Le Comptoir OCTO - Une vision de plateforme sans leadership tech n’est qu’hal...
Le Comptoir OCTO - Une vision de plateforme sans leadership tech n’est qu’hal...OCTO Technology
 
Le Comptoir OCTO - L'avenir de la gestion du bilan carbone : les solutions E...
Le Comptoir OCTO - L'avenir de la gestion du bilan carbone :  les solutions E...Le Comptoir OCTO - L'avenir de la gestion du bilan carbone :  les solutions E...
Le Comptoir OCTO - L'avenir de la gestion du bilan carbone : les solutions E...OCTO Technology
 
Le Comptoir OCTO - Continuous discovery et continuous delivery pour construir...
Le Comptoir OCTO - Continuous discovery et continuous delivery pour construir...Le Comptoir OCTO - Continuous discovery et continuous delivery pour construir...
Le Comptoir OCTO - Continuous discovery et continuous delivery pour construir...OCTO Technology
 
RefCard Tests sur tous les fronts
RefCard Tests sur tous les frontsRefCard Tests sur tous les fronts
RefCard Tests sur tous les frontsOCTO Technology
 
RefCard RESTful API Design
RefCard RESTful API DesignRefCard RESTful API Design
RefCard RESTful API DesignOCTO Technology
 
RefCard API Architecture Strategy
RefCard API Architecture StrategyRefCard API Architecture Strategy
RefCard API Architecture StrategyOCTO Technology
 
LA DUCK CONF 2023 - Journal de bord d’un archi dans l’océan du green
LA DUCK CONF 2023 - Journal de bord d’un archi dans l’océan du greenLA DUCK CONF 2023 - Journal de bord d’un archi dans l’océan du green
LA DUCK CONF 2023 - Journal de bord d’un archi dans l’océan du greenOCTO Technology
 
LA DUCK CONF 2023 - Sous le capot du cloud souverain
LA DUCK CONF 2023 - Sous le capot du cloud souverainLA DUCK CONF 2023 - Sous le capot du cloud souverain
LA DUCK CONF 2023 - Sous le capot du cloud souverainOCTO Technology
 
LA DUCK CONF 2023 - Ré-urbanisation d'un SI à travers une archi évolutive
LA DUCK CONF 2023 - Ré-urbanisation d'un SI à travers une archi évolutiveLA DUCK CONF 2023 - Ré-urbanisation d'un SI à travers une archi évolutive
LA DUCK CONF 2023 - Ré-urbanisation d'un SI à travers une archi évolutiveOCTO Technology
 
LA DUCK CONF 2023 - Parce que nos plateformes le valent bien
LA DUCK CONF 2023 - Parce que nos plateformes le valent bienLA DUCK CONF 2023 - Parce que nos plateformes le valent bien
LA DUCK CONF 2023 - Parce que nos plateformes le valent bienOCTO Technology
 
LA DUCK CONF 2023 - Guider, faire, faire faire ? Une solitude partagée entre ...
LA DUCK CONF 2023 - Guider, faire, faire faire ? Une solitude partagée entre ...LA DUCK CONF 2023 - Guider, faire, faire faire ? Une solitude partagée entre ...
LA DUCK CONF 2023 - Guider, faire, faire faire ? Une solitude partagée entre ...OCTO Technology
 
LA DUCK CONF 2023 - Guide de survie du Change Data Capture
LA DUCK CONF 2023 - Guide de survie du Change Data CaptureLA DUCK CONF 2023 - Guide de survie du Change Data Capture
LA DUCK CONF 2023 - Guide de survie du Change Data CaptureOCTO Technology
 
LA DUCK CONF 2023 - Architecture analytics : déjà-vu ?
LA DUCK CONF 2023 - Architecture analytics : déjà-vu ?LA DUCK CONF 2023 - Architecture analytics : déjà-vu ?
LA DUCK CONF 2023 - Architecture analytics : déjà-vu ?OCTO Technology
 
LA DUCK CONF 2023 - La vie d'Ops au coeur d'un SI en évolution
LA DUCK CONF 2023 - La vie d'Ops au coeur d'un SI en évolutionLA DUCK CONF 2023 - La vie d'Ops au coeur d'un SI en évolution
LA DUCK CONF 2023 - La vie d'Ops au coeur d'un SI en évolutionOCTO Technology
 

More from OCTO Technology (20)

Refcard GraphQL
Refcard GraphQLRefcard GraphQL
Refcard GraphQL
 
Comptoir OCTO ALD Automotive/Leaseplan
Comptoir OCTO ALD Automotive/LeaseplanComptoir OCTO ALD Automotive/Leaseplan
Comptoir OCTO ALD Automotive/Leaseplan
 
Le Comptoir OCTO - Comment optimiser les stocks en linéaire par la Data ?
Le Comptoir OCTO - Comment optimiser les stocks en linéaire par la Data ? Le Comptoir OCTO - Comment optimiser les stocks en linéaire par la Data ?
Le Comptoir OCTO - Comment optimiser les stocks en linéaire par la Data ?
 
Le Comptoir OCTO - Retour sur 5 ans de mise en oeuvre : Comment le RGPD a réi...
Le Comptoir OCTO - Retour sur 5 ans de mise en oeuvre : Comment le RGPD a réi...Le Comptoir OCTO - Retour sur 5 ans de mise en oeuvre : Comment le RGPD a réi...
Le Comptoir OCTO - Retour sur 5 ans de mise en oeuvre : Comment le RGPD a réi...
 
Le Comptoir OCTO - Affinez vos forecasts avec la planification distribuée et...
Le Comptoir OCTO -  Affinez vos forecasts avec la planification distribuée et...Le Comptoir OCTO -  Affinez vos forecasts avec la planification distribuée et...
Le Comptoir OCTO - Affinez vos forecasts avec la planification distribuée et...
 
Le Comptoir OCTO - La formation au cœur de la stratégie d’éco-conception
Le Comptoir OCTO - La formation au cœur de la stratégie d’éco-conceptionLe Comptoir OCTO - La formation au cœur de la stratégie d’éco-conception
Le Comptoir OCTO - La formation au cœur de la stratégie d’éco-conception
 
Le Comptoir OCTO - Une vision de plateforme sans leadership tech n’est qu’hal...
Le Comptoir OCTO - Une vision de plateforme sans leadership tech n’est qu’hal...Le Comptoir OCTO - Une vision de plateforme sans leadership tech n’est qu’hal...
Le Comptoir OCTO - Une vision de plateforme sans leadership tech n’est qu’hal...
 
Le Comptoir OCTO - L'avenir de la gestion du bilan carbone : les solutions E...
Le Comptoir OCTO - L'avenir de la gestion du bilan carbone :  les solutions E...Le Comptoir OCTO - L'avenir de la gestion du bilan carbone :  les solutions E...
Le Comptoir OCTO - L'avenir de la gestion du bilan carbone : les solutions E...
 
Le Comptoir OCTO - Continuous discovery et continuous delivery pour construir...
Le Comptoir OCTO - Continuous discovery et continuous delivery pour construir...Le Comptoir OCTO - Continuous discovery et continuous delivery pour construir...
Le Comptoir OCTO - Continuous discovery et continuous delivery pour construir...
 
RefCard Tests sur tous les fronts
RefCard Tests sur tous les frontsRefCard Tests sur tous les fronts
RefCard Tests sur tous les fronts
 
RefCard RESTful API Design
RefCard RESTful API DesignRefCard RESTful API Design
RefCard RESTful API Design
 
RefCard API Architecture Strategy
RefCard API Architecture StrategyRefCard API Architecture Strategy
RefCard API Architecture Strategy
 
LA DUCK CONF 2023 - Journal de bord d’un archi dans l’océan du green
LA DUCK CONF 2023 - Journal de bord d’un archi dans l’océan du greenLA DUCK CONF 2023 - Journal de bord d’un archi dans l’océan du green
LA DUCK CONF 2023 - Journal de bord d’un archi dans l’océan du green
 
LA DUCK CONF 2023 - Sous le capot du cloud souverain
LA DUCK CONF 2023 - Sous le capot du cloud souverainLA DUCK CONF 2023 - Sous le capot du cloud souverain
LA DUCK CONF 2023 - Sous le capot du cloud souverain
 
LA DUCK CONF 2023 - Ré-urbanisation d'un SI à travers une archi évolutive
LA DUCK CONF 2023 - Ré-urbanisation d'un SI à travers une archi évolutiveLA DUCK CONF 2023 - Ré-urbanisation d'un SI à travers une archi évolutive
LA DUCK CONF 2023 - Ré-urbanisation d'un SI à travers une archi évolutive
 
LA DUCK CONF 2023 - Parce que nos plateformes le valent bien
LA DUCK CONF 2023 - Parce que nos plateformes le valent bienLA DUCK CONF 2023 - Parce que nos plateformes le valent bien
LA DUCK CONF 2023 - Parce que nos plateformes le valent bien
 
LA DUCK CONF 2023 - Guider, faire, faire faire ? Une solitude partagée entre ...
LA DUCK CONF 2023 - Guider, faire, faire faire ? Une solitude partagée entre ...LA DUCK CONF 2023 - Guider, faire, faire faire ? Une solitude partagée entre ...
LA DUCK CONF 2023 - Guider, faire, faire faire ? Une solitude partagée entre ...
 
LA DUCK CONF 2023 - Guide de survie du Change Data Capture
LA DUCK CONF 2023 - Guide de survie du Change Data CaptureLA DUCK CONF 2023 - Guide de survie du Change Data Capture
LA DUCK CONF 2023 - Guide de survie du Change Data Capture
 
LA DUCK CONF 2023 - Architecture analytics : déjà-vu ?
LA DUCK CONF 2023 - Architecture analytics : déjà-vu ?LA DUCK CONF 2023 - Architecture analytics : déjà-vu ?
LA DUCK CONF 2023 - Architecture analytics : déjà-vu ?
 
LA DUCK CONF 2023 - La vie d'Ops au coeur d'un SI en évolution
LA DUCK CONF 2023 - La vie d'Ops au coeur d'un SI en évolutionLA DUCK CONF 2023 - La vie d'Ops au coeur d'un SI en évolution
LA DUCK CONF 2023 - La vie d'Ops au coeur d'un SI en évolution
 

Recently uploaded

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
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
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
 
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
 
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
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 

Recently uploaded (20)

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
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
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
 
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
 
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
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
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
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 

La Duck Conf 2018 : "Life after the CAP Theorem"

  • 1. Life After the CAP Theorem Borémi Toch & Stéphane Lundy
  • 3. 3 Why are we talking about a theorem ?
  • 4. 4 From Pets to Cattle: Distributed is Becoming The Norm
  • 5. 5 So what’s the goal ? ☉ Understand why the CAP Theorem is not that practical, but still useful ☉ Give you practical guidelines when dealing with distributed persistence ☉ Match the system design with the business stakes
  • 9. 9 What is distributed system ? A distributed systemNot a distributed system
  • 10. 10 Your guide for the hike: Mr. Eric Brewer
  • 11. 11 You can’t have the whole pie and eat it, Eric Brewer 2000
  • 12. 12 Getting equipped: a tiny bit of theory
  • 13. 13 Consistency (Linearizability) There must exist a total order on all operations such that each operation looks as if it were completed at a single instant. Gilbert, Lynch, 2002 v1 v2 v3 Read ReadWrite(v2) Read=> v3Write(v3)=> v1 => v3
  • 14. 14 Availability Every request received by a non-failing node in the system must result in a response. Gilbert, Lynch, 2002 Client Request Response
  • 15. 15 Partition Tolerance When a network is partitioned, all messages sent from nodes in one component of the partition to nodes in another component are lost. Gilbert, Lynch, 2002 Distributed System
  • 16. 16 Partition Tolerance When a network is partitioned, all messages sent from nodes in one component of the partition to nodes in another component are lost. Gilbert, Lynch, 2002 Blue Partition Green Partition
  • 17. 17 The Completely Asynchronous Network Assumption
  • 19. 19 2012: Second Take, by Brewer himself ☉ Must read article (available on infoQ) ☉ 12 years of insight into what his original conjecture meant ☉ Easy read with practical examples
  • 20. 20 2015: A Critique of the CAP Theorem, by Martin Kleppmann ☉ Excellent in-depth analysis ☉ Must read to understand the in-depth limitations of the CAP Theorem ☉ Extensive bibliography to dig deeper in the current state of the art
  • 21. CAP Theorem Dismisses Latency ☉ CAP Theorem ignores latency, even though in practice communications rely on it ☉ Availability and partition state cannot be detected instantaneously Blue Partition Green Partition
  • 22. 22 No one can actually forfeit Partitions
  • 23. Consistency and Availability Need Not Be Perfect ☉ The CAP impossibility result holds only for perfect properties ☉ C & A actually range on a spectrum, where tradeoff rules the land Always return v0 Return latest consistent version Return stale version (vN, N>0) Eventual Consistency Super Fragile High Availability 99.999999... availability Useless Holy GrailPragmatic Architecture Consistency Availability
  • 24. >03 How To Use It In Practice
  • 26. 26 Guideline #1: Ask The Partition Question ☉ That’s a system designer question > Should the system restrict operations ? > Should the system proceed ? ☉ And a designer question is actually a business decision What should the system do when a partition occurs ?
  • 27. 27 Guideline #2: Ask The Recovery Question ☉ A system designer has tools to do that, for instance > Last Writer Wins > Linearisation > Compensation > Human escalation ☉ But in the end that is again a business decision How should we resolve the partition conflict ?
  • 28. 28 Guideline #0: Don’t Forget That’s Part Of A Risk Analysis ☉ Overdesign lurks on the dark side ☉ System Designers have tools > KISS: Keep It Simple & Stupid > Measure, Don’t guess (aka. empiricism, test & learn, short feedback loop…) ☉ What are the risks and impacts ? ask the business people Is the likelihood worth the complexity ?
  • 29. 29 A nice drawing to clear things up Time
  • 30. 30 A nice drawing to clear things up Time Partition recovery Partition
  • 31. 31 Hey but it’s just like ☉ Partition is by design ☉ Merge cannot always be completely automated Time Merge Local modifications
  • 32. >04 Other IT Examples And Patterns
  • 33. File Synchronization ☉ Partition is by design ☉ Last Writer Wins strategy (LWW) most of the time ☉ Conflicts are escalated to the user with file names suffixed with (2), (3)... Time Back to base Offline work
  • 34. Document Edition ☉ Edition in the browser, with varying update frequency ☉ Strategies: LWW for whole document or finer text modifications updates Time Merge Local modifications
  • 35. Optimistic Locking Pessimistic Locking Relational Databases Management Systems ☉ Pessimistic Locking is about preventing partitions ☉ Optimistic Locking is about concurrent editing with a First Writer Wins strategy Time
  • 36. Blockchain Mandatory Mention ☉ Blockchains are decentralised systems ☉ In proof of work systems, the longest chain, ie. the most powerful alternative wins Time Merge Uncertainty
  • 37. >05 Business Already Knows It All
  • 38. E-commerce: Stock Management ☉ What do you want : > To check your stock before selling ? > To sell items as fast as possible ? ☉ What do you need ? > It depends !
  • 39. ☉ What do you want : > To check the disponibility of assets ? > To encourage the cash flow ? ☉ What do you need ? > It depends ! ATM: Withdrawal or no Withdrawal
  • 40. ☉ What do you want : > To check users permission ? > To show the up to date content ? ☉ What do you need ? > It depends ! Social Media: Timeline Consistency
  • 42. 42
  • 43. So What to Think about the CAP Theorem ? All models are wrong, but some are useful George E. P. Box
  • 44. 44 Take Away ☉ Though not practical, the CAP Theorem is not useless > It helps raise questions about the Consistency-Availability trade-off > It has fueled many distributed system designs since 2000 ☉ Think about Network Partitions when you design systems > What are the risks ? > What to do when a partition occurs ? > What are the rules to recover from a partition ? ☉ You may actually be more familiar with it than you think > Don’t bicker about being CA, AP, or CP > You already use some distributed IT tools ☉ Never forget : answers come from the business
  • 45. 45 Initiatives To Keep An Eye On ☉ Conflict-free Replicated Data Types aka. CRDT > Started with a paper published by Shapiro & al. 2011 > CRDT ensure worry-free partition recovery > Some products leverage CRDT: Riak, Redis… ☉ Spanner: closing on the CAP impossibility > Cloud Spanner is a fully managed consistent database with high availability > Eric Brewer, now VP of infrastructure at Google has analysed Spanner in the CAP Theorem perspective > Leverages Google infrastructure: highly reliable network & high precision clocks