MySQL Cluster

From Wikipedia, the free encyclopedia

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 very 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 for Network Database).

Contents

[edit] Architecture

MySQL Cluster has a few important concepts behind its design, which give both benefits and disadvantages.

[edit] Replication

MySQL 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 as 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 to four copies at any single time.

[edit] Horizontal Data Partitioning

Data 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.

[edit] In-memory Storage

All data and indexes is currently stored in memory, writing the data to disk asynchronously. The reason it can do this safely is due to the first point above, replication.

[edit] Shared Nothing

MySQL Cluster is designed to have no single point of failure. Provied that the cluster is set up correctly, any single node, system, or piece of hardware can fail without the entire cluster failing. No shared disk (SAN) is required. The interconnects between nodes can be standard Ethernet. Gigabit Ethernet and SCI interconnects are also supported.

[edit] Implementation

MySQL Cluster uses three different types of nodes:

  • Data node (ndbd process): These nodes store the data.
  • Management node (ndb_mgmd process): Used for configuration and monitoring of the cluster. They are required only during node startup.
  • SQL node (mysqld process): A MySQL server (mysqld) that connects to all of the data nodes in order to perform data storage and retrieval.

Generally, it is expected that each node will run on a separate host computer.

[edit] Limitations

The current limitation with the greatest impact lies in the fact is that NDB is largely an in-memory database; all data resides entirely in primary memory. This means that the cluster setup must have sufficient RAM to store the entire dataset. The memory usage can be additive across data 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 data.

In the 5.1 release, non-indexed columns can be stored on disk and do not require dedicated RAM. However, in 5.1, all indexes are still in main memory.

Currently a maximum of 64 nodes can belong to a single MySQL Cluster with up to 48 of those being data nodes. 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 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.

The current maximum number of metadata objects is 1,600. This includes database tables, system tables, and indexes.

Other limitations are listed in the MySQL Manual.

[edit] Alternatives

Alternatives providing high availability for MySQL:

[edit] History

MySQL 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 availabity 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.

[edit] Prominent Users

  • Bredbandsbolaget (B2) - a broadband internet provider in Sweden uses MySQL Cluster for the storage of subscriber profiles and authentication services
  • Viasuisse AG - provides real-time traffic information
  • Neckermann.de GmbH - uses MySQL cluster to store the customer profiles and session data of their online web shop
  • Vodafone UK - uses MySQL cluster for a range of IN Applictions
  • Alcatel- uses MySQL Cluster for HSS and Home Location Register (HLR) applications

[edit] External links

[edit] MySQL AB