MySQL Cluster is a technology which provides shared-nothing clustering capabilities for the MySQL database management system. It was first included in the production release of MySQL 4.1 in November 2004. It is designed to provide high availability and high performance, while allowing for nearly linear scalability. MySQL Cluster is implemented through an additional storage engine available within MySQL called NDB or NDBCLUSTER ("NDB" stands for Network Database).
ArchitectureMySQL Cluster has a few important concepts behind its design, which give both benefits and disadvantages. ReplicationMySQL 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 is in contrast to what is usually referred to as "MySQL Replication", which is asynchronous.) Two copies (known as replicas) of the data are required to guarantee availability; however, the cluster can be configured to store one or two copies at any single time. Starting with MySQL 5.1, it is also possible to replicate asynchronously between clusters; this is sometimes referred to as "MySQL Cluster Replication" or "geographical replication". See MySQL Cluster Replication. Horizontal Data PartitioningData within NDB tables is automatically partitioned across all of the data nodes in the system. This is done based on a hashing algorithm based on the PRIMARY KEY on the table, and is transparent to the end application. In the 5.1 release, users can define their own partitioning schemes. Hybrid StorageMySQL Cluster can store data either in memory or on disk. All data and indexes can be stored in memory, writing the data to disk asynchronously. The reason it can do this safely is due to the first point above, replication. Shared NothingMySQL Cluster is designed to have no single point of failure. Provided that the cluster is set up correctly, any single node, system, or piece of hardware can fail without the entire cluster failing. Shared disk (SAN) is not required. The interconnects between nodes can be standard Ethernet. Gigabit Ethernet and SCI interconnects are also supported. ImplementationMySQL Cluster uses three different types of nodes:
Generally, it is expected that each node will run on a separate host computer. LimitationsIn the 5.1 release, non-indexed columns can be stored on disk and do not require dedicated RAM. However, in 5.0 all indexes as well as all data are still in main memory. In the 5.1 release, a maximum of 255 nodes can belong to a single MySQL Cluster with up to 48 of those being data nodes. In the 5.0 release the total number of nodes cannot exceed 63. It is possible to change this at compile time, but that has not been thoroughly tested at this point. The cluster can not be expanded dynamically, and has to be restarted to introduce new nodes. This limits availability in a dynamic setting. Versions up to and including 5.0 do not have support for variable-width columns, instead using the entire storage width of the column declaration, effectively making a VARCHAR(255) column into a CHAR(255) column. MySQL 5.1 adds true VARCHAR support for NDB tables. Beginning with MySQL 5.0.6, the maximum number of metadata objects has increased to 20320.[1] This includes database tables, system tables, and indexes. Other limitations are listed here MySQL Cluster Limitations 5.0. MySQL Cluster Limitations 5.1. RequirementsMinimum system requirements are as follows (for each node) 3 Machines Minimum
Preferred system requirements are as follows (for each node) 4 Machines Preferred
AlternativesAlternatives providing high availability for MySQL: HistoryMySQL AB acquired the technology behind MySQL Cluster from Alzato, a small venture company started by Ericsson. NDB was originally designed for the telecom market, with its High availability and high performance requirements. The original press release is still available from MySQL AB NDB has since been integrated into the MySQL product, with its first release being in MySQL 4.1. Reference ManualProminent Users
References
External linksMySQL AB
Other
| |