The A and C of ACID & CAP PACELC - sambos/Architectures GitHub Wiki

The A and C of ACID & CAP

Also see PACELC is the new revised version of CAP

The A & C of CAP is not the same as that of ACID, they are different concepts. CAP Theorem is very simplistic in its statement and does not cover all the causes or solutions to consistency or availability.

CAP: In any distributed system there is a fundamental trade-off between consistency, availability, and partition tolerance. A Partition tolerant system (prone for network failures) can either guarantee availability or consistency but not both. In other words, in the presence of partitions (i.e. network failures), a system cannot be both consistent and available, and must choose one of the two. This link shows a good example - Understanding CAP Theorem

Lower availability or lower consistency may be good enough for one set of applications but not for others. On the other hand designing for Ideal C and Ideal A is not (or rather may not be) practical due to its cost-benefit.

CAP theorem a very narrow spectrum of fault (network fault) which do occur, but is not the only possible fault. System should be designed in consideration of wide other possibilities (software bug, latency, node failure etc) that may bring the nodes or partial system (partition) down.

High Availability may not be the same as CAP Availability - Here is a good watch - https://www.youtube.com/watch?v=hUd_9FENShA

PACELC

An alternative to CAP Theorem is PACELC "In case of network partition a system can favor either Availability or Consistency Else you can favor Latency or Consistency."

  • Trade-offs of Consistency and Availability in the presence of Partition, AND Trade-offs of Latency and Consistency when there is no partition

Linearizability vs Sequential Consistency

  • Both care about giving an illusion of a single copy
  • From the outside observer, the system should (almost) behave as if there’s only a single copy
  • Linearizability care about time
  • Consistency cares about program order

Linearizability (Linearizable Consistency / Atomic Consistency)

This is basically CAP Consistency. Your clients should see only one view/copy of the data served, even though there may be copies (replicas, caches) of the data in multiple places. Linearizability is basically consistently providing the same results for the request-B and request-A is made, considering that an event A occured before request-A is made. E.g FIFA 2018 has been just announced and User-A visited the FIFA results Page. Subsequent reloads/requests made by User-B should see the same results seen by User-B.

It can be defined as sequential consistency with the time constraint.

Sequential consistency

Serializable consistency - strict form of Sequential Consistency and is often confused with Sequential Consistency