The CAP Theorem, proposed by Eric Brewer in 2000, states that in a distributed system, you can only guarantee at most two of three properties: Consistency (all nodes return the same data), Availability (nodes respond to requests), and Partition Tolerance (system functions despite network failures); when network partitions occur, systems must sacrifice either consistency or availability to maintain the other two properties.
Understanding the CAP Theorem: Consistency, Availability, Partition Tolerance
Added:hello I'm Michael L Perry and this is the cap theorem the cap theorem was proposed by Eric Brewer in the year 2000 and since then we've learned quite a bit about uh distributed systems based on his work and others so I'd like to go over the cap theum with you real quickly first of all the capap in cap theorem stands for consistency availability and partition tolerance and these are three attributes of the distributed system that is a system made up of multiple machines multiple nodes all uh communicating with one another over a network and these are three promises the consistency guarantee means that if I write to one node then when I read from another node it will return what I just wrote or to be more prise it'll return something no older than what I just wrote because somebody else might be writing to the system at the same time and I might receive something newer but I will never receive something older that's consistency availability is the promise that when I talk to One node it will respond unless of course that node has failed availability allows for failed nodes but if the node has not not failed it will respond partition tolerance means that when the network is partitioned then whatever other promises I've made about the system it will still keep those promises a network is partitioned when messages can't flow from one machine to another this might happen if you are if you have two different data centers and the wide area connection between the two is severed it might also happen if you consider your laptop to be part of the network one of the nodes but then you undock it so the laptop is still on it just can't communicate with the rest of the network so whatever other promises our system makes it's got to uphold those promises in that situation so the cap theorem says that we can only have at most two of these things we cannot have all three and the proof is actually pretty simple suppose I've got a triv trivial distributed system just two nodes if I were to write to one node and then read from another node what would happen furthermore let's suppose that the messages can't get from one node to the other so there are basically three things that could happen one the first node could return the best version that it has which would be older than the one I just wrote but if I'm doing that then I'm not consistent or if we don't want to return an older version and we want to make sure that we get what the user just wrote therefore being consistent then we can wait but if no messages are getting through there's no way for that new version to get there whether the second note is trying to read from the first or the first is trying to write to the second either way no matter what algorithm you choose you can't get that new version on the second node if the messages aren't getting through so in that case I'm not available what's the third thing that could happen the third thing that could happen is of course the message actually does get through so now I can be consistent I can be available but those two promises are dependent upon the network not being partitioned so so I'm not partition tolerant and that is basic proof of the cap theorem I have have to choose one of these three things either I'm not going to be consistent all the time I'm not going to be available all the time or I'm not going to be partition tolerant all the time
Up Next

MIT 6.824 Lecture 1: Introduction to Distributed Systems (Spring 2020)
@6.824
741.5K views•2020-02-06

BitTorrent Protocol Explained: Piece Selection & Peer Choking
@StevenGordonAU
481 views•2013-02-22

HTTP Requests Explained: GET, POST, PUT, DELETE
@codecademy
103.1K views•2021-10-07

Enigma Machine Mechanics: WWII Encryption Explained
@JaredOwen
13.2M views•2021-12-11
Related Study Plans & Knowledge Roadmaps
Structured learning paths in Computer Science


































![Consensus algorithms, Paxos and Raft by Yifan Xing [PWL BOS]](https://i.ytimg.com/vi_webp/fcFqFfsAlSQ/maxresdefault.webp)



