Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can MySQL Cluster 7.3 achieve 99,999% Availability? Antithesis to CAP Theorem

According to the "Guide to Scaling Web Databases with MySQL Cluster", MySQL Cluster 7.3 can acchieve 99,999% availability while using synchronous update replication. This would be a antithesis to the CAP Theorem since it states that perfect availability (99,999% can be seen as this, no?) and consistency is not acchievable in distributed systems.

How would the cluster react for an update, if the datanode which is responsible for the replica, is not reachable? For a synchronous update replication it must block, which would affect availability.

The Guide states:

  • The data within a data node is synchronously replicated to all nodes within the Node Group. If a data node fails, then there is always at least one other data node storing the same information.
  • In the event of a data node failure, the MySQL Server or application node can use any other data node in the node group to execute transactions. The application simply retries the transaction and the remaining data nodes will successfully satisfy the request.

But how can this work if a Node Group consists of two Nodes and one crashes (example here)? There would be no Node to replicate a Update to what, as far as I understand, would make the update fail while using synchronous update replication?! Is the Replication just suspended for the time there does not exist a Node to write a replica to?

like image 689
NorRen Avatar asked Jul 03 '13 11:07

NorRen


People also ask

What is the best way to describe the partition tolerance characteristic of the CAP theorem?

A partition is a communications break within a distributed system—a lost or temporarily delayed connection between two nodes. Partition tolerance means that the cluster must continue to work despite any number of communication breakdowns between nodes in the system.

What is the CAP theorem How is it applicable to NoSQL explain with example?

CAP theorem is known as Brewer's theorem. According to the CAP theorem, there are limitations for the NoSQL database. Against three guarantees of a database, only two can be achieved — consistency, availability and partition tolerance. CAP stands for Consistency, Availability and Partition tolerance.

Why consistency and availability CA is not possible in NoSQL?

NoSQL can not provide consistency and high availability together. This was first expressed by Eric Brewer in CAP Theorem. CAP theorem or Eric Brewers theorem states that we can only achieve at most two out of three guarantees for a database: Consistency, Availability and Partition Tolerance.


1 Answers

On master-master replication if the connection among the hosts are down, then if you try to alter data in any database of any host then certainly to achieve this kind availability the consistency is getting broken. Because now the hosts are not synched and so the data is not consistent. Please look at the below cases:

Case 1: Getting A and C but not P

For example if I don’t replicate a database then the whole database is inside a single host. So here we are getting Consistency and Availability but not Partition tolerance.

Case 2: Getting C and P but not A

For example if I replicate a database(master-master) and keep each one in two hosts. Part P1 is in host H1 and part P2 is in host H2. Now to get partition tolerance I can cut the connection of H1 and H2. Now to get the consistency I shall not allow anyone to change any of P1 and P2. And eventually we are losing Availability.

Case 3: Getting A and P but not C

For example if I replicate a database(master-master) and keep each one in two hosts. Part P1 is in host H1 and part P2 is in host H2. Now to get partition tolerance I can cut the connection of H1 and H2. Now to get the availability I shall allow anyone to change any of P1 and P2. And eventually we are losing Consistency.

like image 144
kayesh parvez Avatar answered Oct 21 '22 08:10

kayesh parvez