Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does the CAP theorem imply that ACID is not possible for distributed databases?

There are NoSQL ACID (distributed) databases, despite CAP theorem. How this is possible? What's the relation between CAP theorem and (possible/not possible of) being ACID?

Is impossible for a distributed computer system to simultaneously provide consistency, availability and partition tolerance.

like image 850
gremo Avatar asked May 27 '13 19:05

gremo


People also ask

What can the distributed database provide according to CAP theorem?

The CAP theorem is a belief from theoretical computer science about distributed data stores that claims, in the event of a network failure on a distributed database, it is possible to provide either consistency or availability—but not both.

How does CAP theorem apply in distributed data models?

The CAP theorem states that a distributed database system has to make a tradeoff between Consistency and Availability when a Partition occurs. A distributed database system is bound to have partitions in a real-world system due to network failure or some other reason.

What is the CAP theorem Why is it important to distributed systems?

The CAP theorem states that a distributed system can only provide two of three properties simultaneously: consistency, availability, and partition tolerance. The theorem formalizes the tradeoff between consistency and availability when there's a partition.

What is the major issue in CAP theorem?

The CAP theorem is a fundamental part of the theory of distributed systems. It states that in the presence of partitions (i.e. network failures), a system cannot be both consistent and available, and must choose one of the two.


2 Answers

CAP theorem is actually a bit misleading. The fact you can have a CA design is nonsense because when a partition occurs you necessarily have a problem regarding consistency (data synchronization issue for example) or availability (latency). That's why there is a more accurate theorem stating that :

During a partition in a distributed system, you must chose between consistency and availability.

Still in practice it is not that simple. You should note that the choice between consistency and availability isn't binary. You can even have some degree of both. For example regarding ACID, you can have atomic and durable transactions with NoSQL, but forfeit a degree of isolation and consistency for better availability. Availability can then be assimilated to latency because your response time will depend on several factors (is the nearest server available ?).

So, to answer your question, this is usually marketing bullshit. You need to actually scratch the surface to see what the solution is exactly gaining and forfeiting.

If you want deeper explanations you can look here, here or here.

like image 72
LMeyer Avatar answered Oct 02 '22 13:10

LMeyer


The PACELC theorem extends CAP to talk about the tradeoffs even when partitions aren't happening. One of the exciting insights for distributed systems, is that they can be made partition tolerant without losing consistency, when consensus protocols such as RAFT or Paxos are used to create a transaction log. The Calvin protocol combines a RAFT log with deterministic transaction application.

FaunaDB implements Calvin, allowing it to maintain ACID transactions with strict-serializability, even during partitions or during replica failure, as long as a quorum of replicas is not partitioned.

like image 32
J Chris A Avatar answered Sep 30 '22 13:09

J Chris A