'''MySQL Cluster''' is a technology which addedprovides [[Shared nothing architecture|shared-nothing]] clustering capabilities tofor the [[MySQL]] [[database management system]],. startingIt withwas first included in the production release of MySQL 4.1 in November 2004. The architectureIt is designed to allow forprovide very high availability and also to provide high performance, while allowing for nearnearly linear scalability. MySQL Cluster is implemented through an additional storage engine available within [[MySQL]] called NDB or NDBCLUSTER ("NDB" stands for for '''N'''etwork '''D'''ata'''b'''ase).
==Architecture==
MySQL Cluster has a few important concepts behind its design, which give both benefits and disadvantages.
===Replication===
NDBMySQL Cluster uses [[synchronous replication]] through a [[two-phase commit]] mechanism in order to guarantee that data is written to multiple nodes upon committing the data. (This Normallyis therein arecontrast twoto copieswhat ofas thewhat datais inusually thereferred to as "[[computerhttp://dev.mysql.com/doc/en/replication.html clusterMySQL Replication]]", which is asynchronous.) Two copies (known as ''replicas'') of the data are required to guarantee availability; however, itthe cluster can be configured to allowstore one to four copies at any single time.
===Horizontal Data Partitioning===
Data within NDB tables areis automatically [[Partition (database)|partitioned]] across all of the data nodes in the system. This is done based on a hashing algorithm based on the [[Primary key|PRIMARY KEY]] on the [[Table (database)|table]]., Thisand is totally transparent to the end [[Application software|application]].
In the 5.1 release, the userusers can define their own partitioning schemeschemes.
===In-memory Storage===
NDB currently stores allAll data and [[Index (database)|indexes]] inis memory.currently stored NDBin onlymemory, writeswriting the data to [[Hard disk|disk]] [[Asynchronous communication|asynchronous]]ly. The reason it can do this safely is due to the first point above, replication.
===Shared Nothing===
NDBMySQL hasCluster is designed to have no [[single point of failure]]. byProvied design.that the Assumingcluster is aset normalup setupcorrectly, any single node, system, or piece of hardware can fail without the entire cluster failing. No shared disk ([[Storage area network|SAN]]) is required. The interconnects between nodes can be normal, standard [[ethernetEthernet]]. Gigabit Ethernet and [[Scalable Coherent Interface|SCI]] interconnects are also supported.
==Implementation==
NDBMySQL hasCluster uses three different types of nodes that are involved in a cluster setup.:
===* '''Data node (ndbd process)===''': These nodes store the data.
* '''Management nodesnode are(ndb_mgmd usedprocess)''': Used for configuration and monitoring of the cluster. They are only required only during node startup. ▼
These nodes are the ones that are actually involved in storing the data in the MySQL Cluster setup.
* '''SQL node (mysqld actsprocess)''': asA aMySQL clientserver node(mysqld) that connectingconnects to all of the data nodes in order to doperform data storage and retrieval. ▼
Generally, it is expected that each node will run on a separate host computer.
===Management node (ndb_mgmd)===
▲Management nodes are used for configuration and monitoring of the cluster. They are only required during node startup.
===Client node (mysqld)===
▲mysqld acts as a client node connecting to all of the data nodes in order to do data storage and retrieval.
==Limitations==
The largestcurrent limitation currentlywith isthe withgreatest impact lies in the fact is that itNDB is largely an [[in-memory database]].; Allall data resides entirely in [[Primary storage|primary memory]]. This means that across the cluster setup, youmust needhave enoughsufficient [[Random access memory|RAM]] to store the entire dataset. The memory usage can be additive across Datadata nodes. For instance, with two replicas and four data nodes, the total amount of RAM needed per data node is 1/2 the total size of the Datadata.
In the 5.1 release, non -indexed columns can be stored on disk and don'tdo not require dedicated RAM. InHowever, in 5.1, all indexes are still need to be in main memory though.
AnotherCurrently limitationa ismaximum withof how many64 nodes can be part of the cluster. Currently you can only have upbelong to 64a nodessingle inMySQL the clusterCluster with up to 48 of those being data nodes that store the actual data. It is possible to change this at compile time, but that has not been thoroughly tested at this point.
Versions up to and including 5.0 do not have support for variable -width fieldscolumns, instead using the entire storage sizewidth of the column declaration, effectively making a varcharVARCHAR(255) column into a charCHAR(255) column. MySQL 5.1 adds true varcharVARCHAR support. for NDB tables.
Also of note, The current maximum number of metadata objects is limited to 1,600. (includingThis includes database tables, system tables, and indexes, etc.)
Other limitations for 4.1 are listed in the [http://dev.mysql.com/doc/mysql/en/MySQL_Cluster_Limitations_in_4.1mysql-cluster-limitations.html MySQL 4.1 Manual].
==Alternatives==
Alternatives to provideproviding high availability tofor MySQL:
*[http://jeremy.zawodny.com/mysql/managing-mysql-replication.html MySQL Replication]
==History==
[[MySQL AB]] acquired the technology behind MySQL Cluster from [[Alzato]], a small [[Venture capital|venture company]] started by [[Ericsson]]. NDB was originally designed for the [[telecomunications|telecom market]], with its [[high availabity]] and high performance requirements. The original press release is still available from [http://www.mysql.com/news-and-events/press-release/release_2003_30.html MySQL AB]
ItNDB has since been integrated into the [[MySQL]] product, with its first release being in MySQL 4.1.
==Prominent Users==
*[http://www.mysql.com/news-and-events/on-demand-webinars/cluster-2005-12-06.php MySQL Webinar on Clustering]
*[http://www.mysql.com/products/cluster/ Cluster Product Overview]
*[http://dev.mysql.com/doc/mysql/en/NDBClustermysql-cluster.html MySQL Cluster Documentation]
*[http://dev.mysql.com/doc/ndbapi/en/index.html MySQL NDB API Developers' Guide]
*[http://dev.mysql.com/tech-resources/articles/mysql-cluster-for-two-servers.html MySQL clusterCluster tutorial]
[[Category:Open source database management systems]]
|