Se ha denunciado esta presentación.
Utilizamos tu perfil de LinkedIn y tus datos de actividad para personalizar los anuncios y mostrarte publicidad más relevante. Puedes cambiar tus preferencias de publicidad en cualquier momento.
CAP theorem
and distributed systems
introduction
Nikanovich Yury
Distributed Systems
Distributed system is a software system in which 
components located on networked computers 
communica...
Scalability
Scalability is the ability of a system, network, or 
process, to handle a growing amount of work in a 
capable...
Permformance aspects
• Short response time/low latency for a given piece of 
work
• High throughput (rate of processing wo...
Availability
Availability = uptime / (uptime + downtime)
Availability %
Downtime per 
year
90 % ("one nine")
More than one...
Fault tolerance
Fault tolerance ­ability of a system to behave in a 
well­defined manner once faults occur.
Failures are n...
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
W...
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 ...
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 guara...
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 partitione...
Thank You!
Questions?
Próxima SlideShare
Cargando en…5
×

CAP theorem and distributed systems

Yura Nikonovich is the first to set up a tradition with his research “CAP theorem and distributed systems”.

In the first part of the report, find his insights into what distributed systems are and what challenges he faced in the course of his work with them.

In the second part of the report Yura tells us about CAP theorem, it's varieties and the future of distributed databases.

  • Inicia sesión para ver los comentarios

CAP theorem and distributed systems

  1. 1. CAP theorem and distributed systems introduction Nikanovich Yury
  2. 2. Distributed Systems Distributed system is a software system in which  components located on networked computers  communicate and coordinate their actions by passing  messages.
  3. 3. 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
  4. 4. 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)
  5. 5. 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
  6. 6. Fault tolerance Fault tolerance ­ability of a system to behave in a  well­defined manner once faults occur. Failures are norm.
  7. 7. Replication Replication is making copies of the same data on  multiple machines.
  8. 8. 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
  9. 9. Replication
  10. 10. Consistency More Consistency Faster reads/writes Strong Probabilistic CRDTs Red­Blue Per­key  sequentional Casual Eventual
  11. 11. 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.
  12. 12. Distributed Databases
  13. 13. ACID • Atomic • Consistent • Isolated • Durable
  14. 14. BASE • Basic Availability • Soft­state • Eventual consistency
  15. 15. 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)
  16. 16. CAP theorem Consistency Availability Partition tolerance Pick 2
  17. 17. CAP theorem and Internet ConsistencyAvailability Partition tolerance
  18. 18. CP systems Available Available
  19. 19. CP systems (Partition) Partition Unavailable Available
  20. 20. CP systems Protocols: • Strict quorum protocols (paxos, raft, zab) • 2PC   Storages: • MongoDB • HBase • Zookeeper
  21. 21. AP systems Available (consistent reads/writes) Available (consistent reads/writes)
  22. 22. AP systems (Partition) Partition Available (inconsistent reads/writes) Available (inconsistent reads/writes)
  23. 23. AP systems Protocols: • Partial quorum protocols Storages: • Couch DB • Cassandra • Amazon Dynamo
  24. 24. 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.
  25. 25. Thank You! Questions?

×