CAP Twelve Years Later:
How the “Rules” Have Changed
Presenters:
- Ayushi Bansal
- Krithiga Murugavel
Brewer, Eric. (2012). CAP Twelve years later: How the "Rules" have Changed. Computer. 45. 23-29. 10.1109/MC.2012.37.
CAP Twelve Years Later: How the Rules Have Changed Presenters: - - - PowerPoint PPT Presentation
CAP Twelve Years Later: How the Rules Have Changed Presenters: - Ayushi Bansal - Krithiga Murugavel Brewer, Eric. (2012). CAP Twelve years later: How the "Rules" have Changed. Computer. 45. 23-29. 10.1109/MC.2012.37. Outline
Presenters:
Brewer, Eric. (2012). CAP Twelve years later: How the "Rules" have Changed. Computer. 45. 23-29. 10.1109/MC.2012.37.
Consistency
Every read receives the most recent write or an error.
Availability
A guarantee that every request receives a response.
Partition Tolerance
The system continues to
despite an arbitrary number
messages being dropped (or delayed) by the network between nodes
https://mwhittaker.github.io/blog/an_illustrated_proof_of_the_cap_theorem/
1 4 3 2 5
1 2 5 4 3 6 7 8
Any networked shared-data system can have at most two of three desirable properties.
https://www.easttexassoftware.com/post/cap-theorem-and-distributed-systems
Hence proved that we cannot have both Consistency, Availability and Partition Tolerance .
Alice 150 Bob 50 Alice 150 Bob 50 100 Revert Transaction Alice 150 50 Bob 50 150 Alice 150 50 Bob 50 100 Mac 100 150 100 50
Atomicity Consistent Isolation
100
transaction preserves all the database rules
Alice Bob 10 40 5 40 ACID CAP
Integrity constraint: A+B = 50
ACID Inconsistency A 5 5 A 5 10 CAP Inconsistency
❏ Applications ❏ Users Involved ❏ Data
between C and A except when part of the service runs on the client.
High Availability Data Replication Consistency vs Latency Yahoo PNUTS
A
A
A
A
B
B B
B
Latency: The delay from input into the system to desired outcome
After Entering Partition Mode Limit operations that leads to reduced availability Record Extra information on
later for recovery
the system prohibits or modifies the
Two goals
○ Undo the mistakes ○ Compensate for mistakes
Vector A Vector B Vector A Vector B
(1,12) (2,14) (3,16) (1,12) (2,14) (3,15) Vector A is newer than Vector B (1,12) (2,14) (3,15) (1,12) (2,14) (3,15) Cannot determine order, updates concurrent , possibly inconsistent
○ Manual merging - offline wiki system ○ Automatic merging - Google Docs
○ Merge concurrent modifications, always, in any order. ○ Rearrange operations into a preferred consistent global order
2 3 1 2 3 1 1 4 5 3 2 3 4 1 2 5 Before Partition During Partition After Partition Recovery 3,2 1 4 5
higher
(violate invariant) and Check balance
○ Withdraw limit - bounds risk ○ Compensation - Extra fee and repayment of money
$1000 $0 $-4000 $5000 $-4000 $2000 $1000 $-3000
Check Kiting
Check of $5000 Withdraw $3000 Check of $5000 Repeat cycle