SlideShare a Scribd company logo
CAP theorem
and distributed systems
introduction
Nikanovich Yury
Distributed Systems
Distributed system is a software system in which 
components located on networked computers 
communicate and coordinate their actions by passing 
messages.
Scalability
Scalability is the ability of a system, network, or 
process, to handle a growing amount of work in a 
capable manner or its ability to be enlarged to 
accommodate that growth.
Two particularly relevant aspects  
• Performance
• Availability
Permformance aspects
• Short response time/low latency for a given piece of 
work
• High throughput (rate of processing work)
• Low utilization of computing resource(s)
Availability
Availability = uptime / (uptime + downtime)
Availability %
Downtime per 
year
90 % ("one nine")
More than one 
month
99.9 % ("three nines")
Less than 9 
hours
99.9999% ("six nines") 31 seconds
Fault tolerance
Fault tolerance ­ability of a system to behave in a 
well­defined manner once faults occur.
Failures are norm.
Replication
Replication is making copies of the same data on 
multiple machines.
Replication
Master-Slave Replication
Node B Node B
Multi-Master Replication
Load
Balancer
Master
Slave A Slave B Slave C
Write Operation
Read Operation
Replication
Node D
Node BNode A Node C
Replication
Consistency
More Consistency Faster reads/writes
Strong
Probabilistic
CRDTs
Red­Blue
Per­key 
sequentional
Casual
Eventual
Why strong consistency is hard to
achieve
Nodes
• each node executes a program concurrently
• knowledge is local
• global state is potentially out of date
• nodes can fail and recover from failure independently
• messages can be delayed or lost 
• clocks are not synchronized across nodes
Links
• Asynchronous system model. 
• No timing assumptions. 
• No bound on message transmission delay
• Useful clocks do not exist.
Distributed Databases
ACID
• Atomic
• Consistent
• Isolated
• Durable
BASE
• Basic Availability
• Soft­state
• Eventual consistency
CAP theorem
It is impossible for a distributed computer system to 
simultaneously provide all three of the following guarantees:
• Consistency (all nodes see the same data at the same time)
• Availability (every request received by a non­failing 
[database] node in the system must result in a [non­error] 
response)
• Partition tolerance (the system continues to operate despite 
arbitrary partitioning due to network failures)
CAP theorem
Consistency
Availability
Partition
tolerance
Pick
2
CAP theorem and Internet
ConsistencyAvailability
Partition
tolerance
CP systems
Available Available
CP systems (Partition)
Partition
Unavailable
Available
CP systems
Protocols:
• Strict quorum protocols (paxos, raft, zab)
• 2PC
 
Storages:
• MongoDB
• HBase
• Zookeeper
AP systems
Available
(consistent
reads/writes)
Available
(consistent
reads/writes)
AP systems (Partition)
Partition
Available
(inconsistent
reads/writes)
Available
(inconsistent
reads/writes)
AP systems
Protocols:
• Partial quorum protocols
Storages:
• Couch DB
• Cassandra
• Amazon Dynamo
CAP fifteen years later
●
Partitions are rare, there is little reason to forfeit C or 
A when the system is not partitioned.
●
Choice between C and A can occur many times 
within the same system at very fine granularity.
●
All three properties are more continuous than binary.
●
Most software doesn’t neatly fit CP/AP definition.
Thank You!
Questions?

More Related Content

PPTX
Introduction to microservices
PPTX
NoSQL databases, the CAP theorem, and the theory of relativity
PPTX
Introduction To Microservices
PDF
Google File System
PPTX
Microservices Architecture & Testing Strategies
PPTX
CAP Theorem
PPTX
Apache Storm
PPT
Hadoop hive presentation
Introduction to microservices
NoSQL databases, the CAP theorem, and the theory of relativity
Introduction To Microservices
Google File System
Microservices Architecture & Testing Strategies
CAP Theorem
Apache Storm
Hadoop hive presentation

What's hot (20)

PDF
Grokking Techtalk #39: Gossip protocol and applications
KEY
Event Driven Architecture
PPTX
cloud computing, Principle and Paradigms: 1 introdution
PDF
Distributed deadlock
PPTX
Communication in Distributed Systems
PPT
PDF
Cloud-based Data Stream Processing
PPTX
CAP Theorem - Theory, Implications and Practices
PPTX
Micro services Architecture
PDF
Orchestration Patterns for Microservices with Messaging by RabbitMQ
PDF
Introducing Saga Pattern in Microservices with Spring Statemachine
PPTX
Introduction to Microservices Patterns
PPTX
Distributed Transaction in Microservice
PDF
Microservices architecture
PPTX
Non functional requirements. do we really care…?
PDF
Consistency Tradeoffs in Modern Distributed Database System Design
PPSX
Microservices Testing Strategies JUnit Cucumber Mockito Pact
PPTX
Disaster recovery and the cloud
PDF
Confluent & GSI Webinars series - Session 3
PPTX
Data center Technologies
 
Grokking Techtalk #39: Gossip protocol and applications
Event Driven Architecture
cloud computing, Principle and Paradigms: 1 introdution
Distributed deadlock
Communication in Distributed Systems
Cloud-based Data Stream Processing
CAP Theorem - Theory, Implications and Practices
Micro services Architecture
Orchestration Patterns for Microservices with Messaging by RabbitMQ
Introducing Saga Pattern in Microservices with Spring Statemachine
Introduction to Microservices Patterns
Distributed Transaction in Microservice
Microservices architecture
Non functional requirements. do we really care…?
Consistency Tradeoffs in Modern Distributed Database System Design
Microservices Testing Strategies JUnit Cucumber Mockito Pact
Disaster recovery and the cloud
Confluent & GSI Webinars series - Session 3
Data center Technologies
 
Ad

Similar to CAP theorem and distributed systems (20)

PDF
Distributed computing for new bloods
PDF
Cap in depth
PDF
A Critique of the CAP Theorem by Martin Kleppmann
PDF
Pass Elk: CAP Theorem since 90s and Beyond
PDF
From Mainframe to Microservice: An Introduction to Distributed Systems
PPTX
U1-T9,T5-Distributed Vs Parallel Processing and Typical Hadoop Environment.pptx
PDF
Building a Distributed System, The Basics
PDF
Distributed Systems explained (with NodeJS) - Bruno Bossola, JUG Torino
PPTX
Distributed System explained (with Java Microservices)
PPTX
Introduction
PPTX
cse40822-CAP.pptx
PDF
System design fundamentals CAP.pdf
PPTX
Put Your Thinking CAP On
RTF
MSB-Distributed systems goals
PPTX
Distributed systems and scalability rules
PPTX
Ignorance of CAP Is Not an Excuse
PPTX
CAP Theorem and Split Brain Syndrome
PDF
Distributed Systems: scalability and high availability
PDF
Distributed clouds — micro clouds
PDF
dist_systems.pdf
Distributed computing for new bloods
Cap in depth
A Critique of the CAP Theorem by Martin Kleppmann
Pass Elk: CAP Theorem since 90s and Beyond
From Mainframe to Microservice: An Introduction to Distributed Systems
U1-T9,T5-Distributed Vs Parallel Processing and Typical Hadoop Environment.pptx
Building a Distributed System, The Basics
Distributed Systems explained (with NodeJS) - Bruno Bossola, JUG Torino
Distributed System explained (with Java Microservices)
Introduction
cse40822-CAP.pptx
System design fundamentals CAP.pdf
Put Your Thinking CAP On
MSB-Distributed systems goals
Distributed systems and scalability rules
Ignorance of CAP Is Not an Excuse
CAP Theorem and Split Brain Syndrome
Distributed Systems: scalability and high availability
Distributed clouds — micro clouds
dist_systems.pdf
Ad

More from Klika Tech, Inc (8)

PDF
The Internet of Things: Impact on Business and Tech-Forward Concepts
PDF
AWS + STM32 Nucleo
PPTX
Writing Scalable React Applications: Dive into React
PPTX
How to Write UI Automated Tests
PPTX
Organization of Automated Testing
PDF
Finite State Machines and C++
PPTX
Writing Scalable React Applications: Introduction
PDF
[Tech Talks] Typesafe Stack Introduction
The Internet of Things: Impact on Business and Tech-Forward Concepts
AWS + STM32 Nucleo
Writing Scalable React Applications: Dive into React
How to Write UI Automated Tests
Organization of Automated Testing
Finite State Machines and C++
Writing Scalable React Applications: Introduction
[Tech Talks] Typesafe Stack Introduction

Recently uploaded (20)

PDF
Decoding a Decade: 10 Years of Applied CTI Discipline
PPTX
Funds Management Learning Material for Beg
PDF
Vigrab.top – Online Tool for Downloading and Converting Social Media Videos a...
PDF
Paper PDF World Game (s) Great Redesign.pdf
PDF
WebRTC in SignalWire - troubleshooting media negotiation
PDF
SASE Traffic Flow - ZTNA Connector-1.pdf
PPT
Design_with_Watersergyerge45hrbgre4top (1).ppt
PPTX
SAP Ariba Sourcing PPT for learning material
PPTX
Job_Card_System_Styled_lorem_ipsum_.pptx
PDF
💰 𝐔𝐊𝐓𝐈 𝐊𝐄𝐌𝐄𝐍𝐀𝐍𝐆𝐀𝐍 𝐊𝐈𝐏𝐄𝐑𝟒𝐃 𝐇𝐀𝐑𝐈 𝐈𝐍𝐈 𝟐𝟎𝟐𝟓 💰
PPTX
introduction about ICD -10 & ICD-11 ppt.pptx
PPTX
Introuction about ICD -10 and ICD-11 PPT.pptx
PPTX
presentation_pfe-universite-molay-seltan.pptx
PDF
Slides PDF The World Game (s) Eco Economic Epochs.pdf
PPTX
PptxGenJS_Demo_Chart_20250317130215833.pptx
PDF
The New Creative Director: How AI Tools for Social Media Content Creation Are...
PPTX
Module 1 - Cyber Law and Ethics 101.pptx
PDF
The Internet -By the Numbers, Sri Lanka Edition
PDF
RPKI Status Update, presented by Makito Lay at IDNOG 10
PPTX
QR Codes Qr codecodecodecodecocodedecodecode
Decoding a Decade: 10 Years of Applied CTI Discipline
Funds Management Learning Material for Beg
Vigrab.top – Online Tool for Downloading and Converting Social Media Videos a...
Paper PDF World Game (s) Great Redesign.pdf
WebRTC in SignalWire - troubleshooting media negotiation
SASE Traffic Flow - ZTNA Connector-1.pdf
Design_with_Watersergyerge45hrbgre4top (1).ppt
SAP Ariba Sourcing PPT for learning material
Job_Card_System_Styled_lorem_ipsum_.pptx
💰 𝐔𝐊𝐓𝐈 𝐊𝐄𝐌𝐄𝐍𝐀𝐍𝐆𝐀𝐍 𝐊𝐈𝐏𝐄𝐑𝟒𝐃 𝐇𝐀𝐑𝐈 𝐈𝐍𝐈 𝟐𝟎𝟐𝟓 💰
introduction about ICD -10 & ICD-11 ppt.pptx
Introuction about ICD -10 and ICD-11 PPT.pptx
presentation_pfe-universite-molay-seltan.pptx
Slides PDF The World Game (s) Eco Economic Epochs.pdf
PptxGenJS_Demo_Chart_20250317130215833.pptx
The New Creative Director: How AI Tools for Social Media Content Creation Are...
Module 1 - Cyber Law and Ethics 101.pptx
The Internet -By the Numbers, Sri Lanka Edition
RPKI Status Update, presented by Makito Lay at IDNOG 10
QR Codes Qr codecodecodecodecocodedecodecode

CAP theorem and distributed systems