21.2 NDB Cluster Overview

NDB Cluster is a technology that enables clustering of in-memory databases in a shared-nothing system. The shared-nothing architecture enables the system to work with very inexpensive hardware, and with a minimum of specific requirements for hardware or software.

NDB Cluster is designed not to have any single point of failure. In a shared-nothing system, each component is expected to have its own memory and disk, and the use of shared storage mechanisms such as network shares, network file systems, and SANs is not recommended or supported.

NDB Cluster integrates the standard MySQL server with an in-memory clustered storage engine called *note 'NDB': mysql-cluster. (which stands for '_N_etwork _D_ata_B_ase'). In our documentation, the term note 'NDB': mysql-cluster. refers to the part of the setup that is specific to the storage engine, whereas 'MySQL NDB Cluster' refers to the combination of one or more MySQL servers with the note 'NDB': mysql-cluster. storage engine.

An NDB Cluster consists of a set of computers, known as hosts, each running one or more processes. These processes, known as nodes, may include MySQL servers (for access to NDB data), data nodes (for storage of the data), one or more management servers, and possibly other specialized data access programs. The relationship of these components in an NDB Cluster is shown here:

FIGURE GOES HERE: NDB Cluster Components

All these programs work together to form an NDB Cluster (see note mysql-cluster-programs::. When data is stored by the note 'NDB': mysql-cluster. storage engine, the tables (and table data) are stored in the data nodes. Such tables are directly accessible from all other MySQL servers (SQL nodes) in the cluster. Thus, in a payroll application storing data in a cluster, if one application updates the salary of an employee, all other MySQL servers that query this data can see this change immediately.

Although an NDB Cluster SQL node uses the note 'mysqld': mysqld. server daemon, it differs in a number of critical respects from the note 'mysqld': mysqld. binary supplied with the MySQL 5.7 distributions, and the two versions of *note 'mysqld': mysqld. are not interchangeable.

In addition, a MySQL server that is not connected to an NDB Cluster cannot use the *note 'NDB': mysql-cluster. storage engine and cannot access any NDB Cluster data.

The data stored in the data nodes for NDB Cluster can be mirrored; the cluster can handle failures of individual data nodes with no other impact than that a small number of transactions are aborted due to losing the transaction state. Because transactional applications are expected to handle transaction failure, this should not be a source of problems.

Individual nodes can be stopped and restarted, and can then rejoin the system (cluster). Rolling restarts (in which all nodes are restarted in turn) are used in making configuration changes and software upgrades (see note mysql-cluster-rolling-restart::). Rolling restarts are also used as part of the process of adding new data nodes online (see note mysql-cluster-online-add-node::). For more information about data nodes, how they are organized in an NDB Cluster, and how they handle and store NDB Cluster data, see *note mysql-cluster-nodes-groups::.

Backing up and restoring NDB Cluster databases can be done using the 'NDB'-native functionality found in the NDB Cluster management client and the note 'ndb_restore': mysql-cluster-programs-ndb-restore. program included in the NDB Cluster distribution. For more information, see note mysql-cluster-backup::, and note mysql-cluster-programs-ndb-restore::. You can also use the standard MySQL functionality provided for this purpose in note 'mysqldump': mysqldump. and the MySQL server. See *note mysqldump::, for more information.

NDB Cluster nodes can employ different transport mechanisms for inter-node communications; TCP/IP over standard 100 Mbps or faster Ethernet hardware is used in most real-world deployments.

 File: manual.info.tmp, Node: mysql-cluster-basics, Next: mysql-cluster-nodes-groups, Prev: mysql-cluster-overview, Up: mysql-cluster-overview

21.2.1 NDB Cluster Core Concepts

_note 'NDBCLUSTER': mysql-cluster._ (also known as note 'NDB': mysql-cluster.) is an in-memory storage engine offering high-availability and data-persistence features.

The note 'NDBCLUSTER': mysql-cluster. storage engine can be configured with a range of failover and load-balancing options, but it is easiest to start with the storage engine at the cluster level. NDB Cluster's note 'NDB': mysql-cluster. storage engine contains a complete set of data, dependent only on other data within the cluster itself.

The 'Cluster' portion of NDB Cluster is configured independently of the MySQL servers. In an NDB Cluster, each part of the cluster is considered to be a node.

Note:

In many contexts, the term 'node' is used to indicate a computer, but when discussing NDB Cluster it means a process. It is possible to run multiple nodes on a single computer; for a computer on which one or more cluster nodes are being run we use the term cluster host.

There are three types of cluster nodes, and in a minimal NDB Cluster configuration, there must be at least three nodes, one of each of these types:

Important:

It is not realistic to expect to employ a three-node setup in a production environment. Such a configuration provides no redundancy; to benefit from NDB Cluster's high-availability features, you must use multiple data and SQL nodes. The use of multiple management nodes is also highly recommended.

For a brief introduction to the relationships between nodes, node groups, fragment replicas, and partitions in NDB Cluster, see *note mysql-cluster-nodes-groups::.

Configuration of a cluster involves configuring each individual node in the cluster and setting up individual communication links between nodes. NDB Cluster is currently designed with the intention that data nodes are homogeneous in terms of processor power, memory space, and bandwidth. In addition, to provide a single point of configuration, all configuration data for the cluster as a whole is located in one configuration file.

The management server manages the cluster configuration file and the cluster log. Each node in the cluster retrieves the configuration data from the management server, and so requires a way to determine where the management server resides. When interesting events occur in the data nodes, the nodes transfer information about these events to the management server, which then writes the information to the cluster log.

In addition, there can be any number of cluster client processes or applications. These include standard MySQL clients, 'NDB'-specific API programs, and management clients. These are described in the next few paragraphs.

Standard MySQL clients

NDB Cluster can be used with existing MySQL applications written in PHP, Perl, C, C++, Java, Python, and so on. Such client applications send SQL statements to and receive responses from MySQL servers acting as NDB Cluster SQL nodes in much the same way that they interact with standalone MySQL servers.

MySQL clients using an NDB Cluster as a data source can be modified to take advantage of the ability to connect with multiple MySQL servers to achieve load balancing and failover. For example, Java clients using Connector/J 5.0.6 and later can use 'jdbc:mysql:loadbalance://' URLs (improved in Connector/J 5.1.7) to achieve load balancing transparently; for more information about using Connector/J with NDB Cluster, see Using Connector/J with NDB Cluster (https://dev.mysql.com/doc/ndbapi/en/mccj-using-connectorj.html).

NDB client programs

Client programs can be written that access NDB Cluster data directly from the 'NDBCLUSTER' storage engine, bypassing any MySQL Servers that may be connected to the cluster, using the NDB API, a high-level C++ API. Such applications may be useful for specialized purposes where an SQL interface to the data is not needed. For more information, see The NDB API (https://dev.mysql.com/doc/ndbapi/en/ndbapi.html).

'NDB'-specific Java applications can also be written for NDB Cluster using the NDB Cluster Connector for Java. This NDB Cluster Connector includes ClusterJ, a high-level database API similar to object-relational mapping persistence frameworks such as Hibernate and JPA that connect directly to 'NDBCLUSTER', and so does not require access to a MySQL Server. See Java and NDB Cluster (https://dev.mysql.com/doc/ndbapi/en/mccj-overview-java.html), and The ClusterJ API and Data Object Model (https://dev.mysql.com/doc/ndbapi/en/mccj-overview-clusterj-object-models.html), for more information.

Management clients

These clients connect to the management server and provide commands for starting and stopping nodes gracefully, starting and stopping message tracing (debug versions only), showing node versions and status, starting and stopping backups, and so on. An example of this type of program is the note 'ndb_mgm': mysql-cluster-programs-ndb-mgm. management client supplied with NDB Cluster (see note mysql-cluster-programs-ndb-mgm::). Such applications can be written using the MGM API, a C-language API that communicates directly with one or more NDB Cluster management servers. For more information, see The MGM API (https://dev.mysql.com/doc/ndbapi/en/mgm-api.html).

Oracle also makes available MySQL Cluster Manager, which provides an advanced command-line interface simplifying many complex NDB Cluster management tasks, such restarting an NDB Cluster with a large number of nodes. The MySQL Cluster Manager client also supports commands for getting and setting the values of most node configuration parameters as well as *note 'mysqld': mysqld. server options and variables relating to NDB Cluster. See MySQL Cluster Manager 1.4.8 User Manual (https://dev.mysql.com/doc/mysql-cluster-manager/1.4/en/), for more information.

Event logs

NDB Cluster logs events by category (startup, shutdown, errors, checkpoints, and so on), priority, and severity. A complete listing of all reportable events may be found in *note mysql-cluster-event-reports::. Event logs are of the two types listed here:

Note:

Under normal circumstances, it is necessary and sufficient to keep and examine only the cluster log. The node logs need be consulted only for application development and debugging purposes.

Checkpoint

Generally speaking, when data is saved to disk, it is said that a checkpoint has been reached. More specific to NDB Cluster, a checkpoint is a point in time where all committed transactions are stored on disk. With regard to the *note 'NDB': mysql-cluster. storage engine, there are two types of checkpoints which work together to ensure that a consistent view of the cluster's data is maintained. These are shown in the following list:

For more information about the files and directories created by local checkpoints and global checkpoints, see NDB Cluster Data Node File System Directory (https://dev.mysql.com/doc/ndb-internals/en/ndb-internals-ndbd-filesystemdir-files.html).

Transporter

We use the term transporter for the data transport mechanism employed between data nodes. MySQL NDB Cluster 7.5 and 7.6 support three of these, which are listed here:

Because it is ubiquitous, most users employ TCP/IP over Ethernet for NDB Cluster.

Regardless of the transporter used, 'NDB' attempts to make sure that communication between data node processes is performed using chunks that are as large as possible since this benefits all types of data transmission.

 File: manual.info.tmp, Node: mysql-cluster-nodes-groups, Next: mysql-cluster-overview-requirements, Prev: mysql-cluster-basics, Up: mysql-cluster-overview

21.2.2 NDB Cluster Nodes, Node Groups, Fragment Replicas, and Partitions

This section discusses the manner in which NDB Cluster divides and duplicates data for storage.

A number of concepts central to an understanding of this topic are discussed in the next few paragraphs.

Data node

An note 'ndbd': mysql-cluster-programs-ndbd. or note 'ndbmtd': mysql-cluster-programs-ndbmtd. process, which stores one or more fragment replicas--that is, copies of the partitions (discussed later in this section) assigned to the node group of which the node is a member.

Each data node should be located on a separate computer. While it is also possible to host multiple data node processes on a single computer, such a configuration is not usually recommended.

It is common for the terms 'node' and 'data node' to be used interchangeably when referring to an note 'ndbd': mysql-cluster-programs-ndbd. or note 'ndbmtd': mysql-cluster-programs-ndbmtd. process; where mentioned, management nodes (note 'ndb_mgmd': mysql-cluster-programs-ndb-mgmd. processes) and SQL nodes (note 'mysqld': mysqld. processes) are specified as such in this discussion.

Node group

A node group consists of one or more nodes, and stores partitions, or sets of fragment replicas (see next item).

The number of node groups in an NDB Cluster is not directly configurable; it is a function of the number of data nodes and of the number of fragment replicas ('NoOfReplicas' configuration parameter), as shown here:

 [# of node groups] = [# of data nodes] / NoOfReplicas

Thus, an NDB Cluster with 4 data nodes has 4 node groups if 'NoOfReplicas' is set to 1 in the 'config.ini' file, 2 node groups if 'NoOfReplicas' is set to 2, and 1 node group if 'NoOfReplicas' is set to 4. Fragment replicas are discussed later in this section; for more information about 'NoOfReplicas', see *note mysql-cluster-ndbd-definition::.

Note:

All node groups in an NDB Cluster must have the same number of data nodes.

You can add new node groups (and thus new data nodes) online, to a running NDB Cluster; see *note mysql-cluster-online-add-node::, for more information.

Partition

This is a portion of the data stored by the cluster. Each node is responsible for keeping at least one copy of any partitions assigned to it (that is, at least one fragment replica) available to the cluster.

The number of partitions used by default by NDB Cluster depends on the number of data nodes and the number of LDM threads in use by the data nodes, as shown here:

 [# of partitions] = [# of data nodes] * [# of LDM threads]

When using data nodes running note 'ndbmtd': mysql-cluster-programs-ndbmtd, the number of LDM threads is controlled by the setting for 'MaxNoOfExecutionThreads'. When using note 'ndbd': mysql-cluster-programs-ndbd. there is a single LDM thread, which means that there are as many cluster partitions as nodes participating in the cluster. This is also the case when using *note 'ndbmtd': mysql-cluster-programs-ndbmtd. with 'MaxNoOfExecutionThreads' set to 3 or less. (You should be aware that the number of LDM threads increases with the value of this parameter, but not in a strictly linear fashion, and that there are additional constraints on setting it; see the description of 'MaxNoOfExecutionThreads' for more information.)

NDB and user-defined partitioning

NDB Cluster normally partitions note 'NDBCLUSTER': mysql-cluster. tables automatically. However, it is also possible to employ user-defined partitioning with note 'NDBCLUSTER': mysql-cluster. tables. This is subject to the following limitations:

  1. Only the 'KEY' and 'LINEAR KEY' partitioning schemes are supported in production with *note 'NDB': mysql-cluster. tables.

  2. The maximum number of partitions that may be defined explicitly for any note 'NDB': mysql-cluster. table is '8 [NUMBER OF LDM THREADS] * [NUMBER OF NODE GROUPS]', the number of node groups in an NDB Cluster being determined as discussed previously in this section. When running note 'ndbd': mysql-cluster-programs-ndbd. for data node processes, setting the number of LDM threads has no effect (since 'ThreadConfig' applies only to note 'ndbmtd': mysql-cluster-programs-ndbmtd.); in such cases, this value can be treated as though it were equal to 1 for purposes of performing this calculation.

    See *note mysql-cluster-programs-ndbmtd::, for more information.

For more information relating to NDB Cluster and user-defined partitioning, see note mysql-cluster-limitations::, and note partitioning-limitations-storage-engines::.

Fragment replica

This is a copy of a cluster partition. Each node in a node group stores a fragment replica. Also sometimes known as a partition replica. The number of fragment replicas is equal to the number of nodes per node group.

A fragment replica belongs entirely to a single node; a node can (and usually does) store several fragment replicas.

The following diagram illustrates an NDB Cluster with four data nodes running *note 'ndbd': mysql-cluster-programs-ndbd, arranged in two node groups of two nodes each; nodes 1 and 2 belong to node group 0, and nodes 3 and 4 belong to node group 1.

Note:

Only data nodes are shown here; although a working NDB Cluster requires an *note 'ndb_mgmd': mysql-cluster-programs-ndb-mgmd. process for cluster management and at least one SQL node to access the data stored by the cluster, these have been omitted from the figure for clarity.

FIGURE GOES HERE: NDB Cluster with Two Node Groups

The data stored by the cluster is divided into four partitions, numbered 0, 1, 2, and 3. Each partition is stored--in multiple copies--on the same node group. Partitions are stored on alternate node groups as follows:

What this means regarding the continued operation of an NDB Cluster is this: so long as each node group participating in the cluster has at least one node operating, the cluster has a complete copy of all data and remains viable. This is illustrated in the next diagram.

FIGURE GOES HERE: Nodes Required for a 2x2 NDB Cluster

In this example, the cluster consists of two node groups each consisting of two data nodes. Each data node is running an instance of *note 'ndbd': mysql-cluster-programs-ndbd. Any combination of at least one node from node group 0 and at least one node from node group 1 is sufficient to keep the cluster 'alive'. However, if both nodes from a single node group fail, the combination consisting of the remaining two nodes in the other node group is not sufficient. In this situation, the cluster has lost an entire partition and so can no longer provide access to a complete set of all NDB Cluster data.

In NDB 7.5.4 and later, the maximum number of node groups supported for a single NDB Cluster instance is 48 (Bug#80845, Bug #22996305).

 File: manual.info.tmp, Node: mysql-cluster-overview-requirements, Next: mysql-cluster-what-is-new, Prev: mysql-cluster-nodes-groups, Up: mysql-cluster-overview

21.2.3 NDB Cluster Hardware, Software, and Networking Requirements

One of the strengths of NDB Cluster is that it can be run on commodity hardware and has no unusual requirements in this regard, other than for large amounts of RAM, due to the fact that all live data storage is done in memory. (It is possible to reduce this requirement using Disk Data tables--see *note mysql-cluster-disk-data::, for more information about these.) Naturally, multiple and faster CPUs can enhance performance. Memory requirements for other NDB Cluster processes are relatively small.

The software requirements for NDB Cluster are also modest. Host operating systems do not require any unusual modules, services, applications, or configuration to support NDB Cluster. For supported operating systems, a standard installation should be sufficient. The MySQL software requirements are simple: all that is needed is a production release of NDB Cluster. It is not strictly necessary to compile MySQL yourself merely to be able to use NDB Cluster. We assume that you are using the binaries appropriate to your platform, available from the NDB Cluster software downloads page at https://dev.mysql.com/downloads/cluster/.

For communication between nodes, NDB Cluster supports TCP/IP networking in any standard topology, and the minimum expected for each host is a standard 100 Mbps Ethernet card, plus a switch, hub, or router to provide network connectivity for the cluster as a whole. We strongly recommend that an NDB Cluster be run on its own subnet which is not shared with machines not forming part of the cluster for the following reasons:

Network communication and latency

NDB Cluster requires communication between data nodes and API nodes (including SQL nodes), as well as between data nodes and other data nodes, to execute queries and updates. Communication latency between these processes can directly affect the observed performance and latency of user queries. In addition, to maintain consistency and service despite the silent failure of nodes, NDB Cluster uses heartbeating and timeout mechanisms which treat an extended loss of communication from a node as node failure. This can lead to reduced redundancy. Recall that, to maintain data consistency, an NDB Cluster shuts down when the last node in a node group fails. Thus, to avoid increasing the risk of a forced shutdown, breaks in communication between nodes should be avoided wherever possible.

The failure of a data or API node results in the abort of all uncommitted transactions involving the failed node. Data node recovery requires synchronization of the failed node's data from a surviving data node, and re-establishment of disk-based redo and checkpoint logs, before the data node returns to service. This recovery can take some time, during which the Cluster operates with reduced redundancy.

Heartbeating relies on timely generation of heartbeat signals by all nodes. This may not be possible if the node is overloaded, has insufficient machine CPU due to sharing with other programs, or is experiencing delays due to swapping. If heartbeat generation is sufficiently delayed, other nodes treat the node that is slow to respond as failed.

This treatment of a slow node as a failed one may or may not be desirable in some circumstances, depending on the impact of the node's slowed operation on the rest of the cluster. When setting timeout values such as 'HeartbeatIntervalDbDb' and 'HeartbeatIntervalDbApi' for NDB Cluster, care must be taken care to achieve quick detection, failover, and return to service, while avoiding potentially expensive false positives.

Where communication latencies between data nodes are expected to be higher than would be expected in a LAN environment (on the order of 100 µs), timeout parameters must be increased to ensure that any allowed periods of latency periods are well within configured timeouts. Increasing timeouts in this way has a corresponding effect on the worst-case time to detect failure and therefore time to service recovery.

LAN environments can typically be configured with stable low latency, and such that they can provide redundancy with fast failover. Individual link failures can be recovered from with minimal and controlled latency visible at the TCP level (where NDB Cluster normally operates). WAN environments may offer a range of latencies, as well as redundancy with slower failover times. Individual link failures may require route changes to propagate before end-to-end connectivity is restored. At the TCP level this can appear as large latencies on individual channels. The worst-case observed TCP latency in these scenarios is related to the worst-case time for the IP layer to reroute around the failures.

 File: manual.info.tmp, Node: mysql-cluster-what-is-new, Next: mysql-cluster-added-deprecated-removed, Prev: mysql-cluster-overview-requirements, Up: mysql-cluster-overview

21.2.4 What is New in MySQL NDB Cluster

The following sections describe changes in the implementation of MySQL NDB Cluster in NDB Cluster 7.6 through 5.7.44-ndb-7.6.34 and NDB Cluster 7.5 through 5.7.44-ndb-7.5.36 as compared to earlier release series. NDB Cluster 8.0 is available as a General Availability (GA) release, beginning with NDB 8.0.19; see What is New in MySQL NDB Cluster 8.0 (https://dev.mysql.com/doc/refman/8.0/en/mysql-cluster-what-is-new.html), for more information about new features and other changes in NDB 8.0. NDB Cluster 7.6 and 7.5 are previous GA releases still supported in production; for information about NDB Cluster 7.6, see note mysql-cluster-what-is-new-7-6::. For information about NDB Cluster 7.5, see note mysql-cluster-what-is-new-7-5::. NDB Cluster 7.4 and 7.3 were previous GA releases which have reached their end of life, and which are no longer supported or maintained. We recommend that new deployments for production use MySQL NDB Cluster 8.0.

 File: manual.info.tmp, Node: mysql-cluster-what-is-new-7-5, Next: mysql-cluster-what-is-new-7-6, Prev: mysql-cluster-what-is-new, Up: mysql-cluster-what-is-new

21.2.4.1 What is New in NDB Cluster 7.5 .......................................

Major changes and new features in NDB Cluster 7.5 which are likely to be of interest are shown in the following list:

ClusterJPA is no longer supported beginning with NDB 7.5.7; its source code and binary have been removed from the NDB Cluster distribution.

NDB Cluster 7.5 is also supported by MySQL Cluster Manager, which provides an advanced command-line interface that can simplify many complex NDB Cluster management tasks. See MySQL Cluster Manager 1.4.8 User Manual (https://dev.mysql.com/doc/mysql-cluster-manager/1.4/en/), for more information.

 File: manual.info.tmp, Node: mysql-cluster-what-is-new-7-6, Prev: mysql-cluster-what-is-new-7-5, Up: mysql-cluster-what-is-new

21.2.4.2 What is New in NDB Cluster 7.6 .......................................

New features and other important changes in NDB Cluster 7.6 which are likely to be of interest are shown in the following list:

 File: manual.info.tmp, Node: mysql-cluster-added-deprecated-removed, Next: mysql-cluster-compared, Prev: mysql-cluster-what-is-new, Up: mysql-cluster-overview

21.2.5 NDB: Added, Deprecated, and Removed Options, Variables, and Parameters

 File: manual.info.tmp, Node: mysql-cluster-added-deprecated-removed-7-5, Next: mysql-cluster-added-deprecated-removed-7-6, Prev: mysql-cluster-added-deprecated-removed, Up: mysql-cluster-added-deprecated-removed

21.2.5.1 Options, Variables, and Parameters Added, Deprecated or Removed in NDB 7.5 ...................................................................................

The next few sections contain information about 'NDB' node configuration parameters and NDB-specific *note 'mysqld': mysqld. options and variables that have been added to, deprecated in, or removed from NDB 7.5.

Parameters Introduced in NDB 7.5

The following node configuration parameters have been added in NDB 7.5.

Parameters Deprecated in NDB 7.5

The following node configuration parameters have been deprecated in NDB 7.5.

Parameters Removed in NDB 7.5

The following node configuration parameters have been removed in NDB 7.5.

Options and Variables Introduced in NDB 7.5

The following system variables, status variables, and server options have been added in NDB 7.5.

Options and Variables Deprecated in NDB 7.5

No system variables, status variables, or server options have been deprecated in NDB 7.5.

Options and Variables Removed in NDB 7.5

No system variables, status variables, or options have been removed in NDB 7.5.

 File: manual.info.tmp, Node: mysql-cluster-added-deprecated-removed-7-6, Prev: mysql-cluster-added-deprecated-removed-7-5, Up: mysql-cluster-added-deprecated-removed

21.2.5.2 Options, Variables, and Parameters Added, Deprecated or Removed in NDB 7.6 ...................................................................................

The next few sections contain information about 'NDB' node configuration parameters and NDB-specific *note 'mysqld': mysqld. options and variables that have been added to, deprecated in, or removed from NDB 7.6.

Parameters Introduced in NDB 7.6

The following node configuration parameters have been added in NDB 7.6.

Parameters Deprecated in NDB 7.6

The following node configuration parameters have been deprecated in NDB 7.6.

Parameters Removed in NDB 7.6

No node configuration parameters have been removed in NDB 7.6.

Options and Variables Introduced in NDB 7.6

The following system variables, status variables, and server options have been added in NDB 7.6.

Options and Variables Deprecated in NDB 7.6

No system variables, status variables, or server options have been deprecated in NDB 7.6.

Options and Variables Removed in NDB 7.6

No system variables, status variables, or options have been removed in NDB 7.6.

 File: manual.info.tmp, Node: mysql-cluster-compared, Next: mysql-cluster-limitations, Prev: mysql-cluster-added-deprecated-removed, Up: mysql-cluster-overview

21.2.6 MySQL Server Using InnoDB Compared with NDB Cluster

MySQL Server offers a number of choices in storage engines. Since both note 'NDB': mysql-cluster. and note 'InnoDB': innodb-storage-engine. can serve as transactional MySQL storage engines, users of MySQL Server sometimes become interested in NDB Cluster. They see note 'NDB': mysql-cluster. as a possible alternative or upgrade to the default note 'InnoDB': innodb-storage-engine. storage engine in MySQL 5.7. While note 'NDB': mysql-cluster. and note 'InnoDB': innodb-storage-engine. share common characteristics, there are differences in architecture and implementation, so that some existing MySQL Server applications and usage scenarios can be a good fit for NDB Cluster, but not all of them.

In this section, we discuss and compare some characteristics of the note 'NDB': mysql-cluster. storage engine used by NDB 7.5 with note 'InnoDB': innodb-storage-engine. used in MySQL 5.7. The next few sections provide a technical comparison. In many instances, decisions about when and where to use NDB Cluster must be made on a case-by-case basis, taking all factors into consideration. While it is beyond the scope of this documentation to provide specifics for every conceivable usage scenario, we also attempt to offer some very general guidance on the relative suitability of some common types of applications for note 'NDB': mysql-cluster. as opposed to note 'InnoDB': innodb-storage-engine. back ends.

NDB Cluster 7.5 uses a note 'mysqld': mysqld. based on MySQL 5.7, including support for note 'InnoDB': innodb-storage-engine. 1.1. While it is possible to use 'InnoDB' tables with NDB Cluster, such tables are not clustered. It is also not possible to use programs or libraries from an NDB Cluster 7.5 distribution with MySQL Server 5.7, or the reverse.

While it is also true that some types of common business applications can be run either on NDB Cluster or on MySQL Server (most likely using the note 'InnoDB': innodb-storage-engine. storage engine), there are some important architectural and implementation differences. note mysql-cluster-ndb-innodb-engines::, provides a summary of the these differences. Due to the differences, some usage scenarios are clearly more suitable for one engine or the other; see note mysql-cluster-ndb-innodb-workloads::. This in turn has an impact on the types of applications that better suited for use with note 'NDB': mysql-cluster. or note 'InnoDB': innodb-storage-engine. See note mysql-cluster-ndb-innodb-usage::, for a comparison of the relative suitability of each for use in common types of database applications.

For information about the relative characteristics of the note 'NDB': mysql-cluster. and note 'MEMORY': memory-storage-engine. storage engines, see *note memory-storage-engine-compared-cluster::.

See *note storage-engines::, for additional information about MySQL storage engines.

 File: manual.info.tmp, Node: mysql-cluster-ndb-innodb-engines, Next: mysql-cluster-ndb-innodb-workloads, Prev: mysql-cluster-compared, Up: mysql-cluster-compared

21.2.6.1 Differences Between the NDB and InnoDB Storage Engines ...............................................................

The note 'NDB': mysql-cluster. storage engine is implemented using a distributed, shared-nothing architecture, which causes it to behave differently from note 'InnoDB': innodb-storage-engine. in a number of ways. For those unaccustomed to working with *note 'NDB': mysql-cluster, unexpected behaviors can arise due to its distributed nature with regard to transactions, foreign keys, table limits, and other characteristics. These are shown in the following table:

Feature 'InnoDB' (MySQL 5.7) 'NDB' 7.5/7.6

MySQL Server Version

5.7 5.7

_*note 'InnoDB': innodb-storage-engine. Version _

note 'InnoDB': innodb-storage-engine.note 'InnoDB': innodb-storage-engine. 5.7.44 5.7.44

NDB Cluster Version

N/A *note 'NDB': mysql-cluster. 7.5.36/7.6.34

Storage Limits

64TB 128TB (as of NDB 7.5.2)

Foreign Keys

Yes Yes

Transactions

All standard types 'READ COMMITTED'

MVCC

Yes No

Data Compression

Yes No (NDB checkpoint and backup files can be compressed)

Large Row Support (> 14K)

Supported for Supported for note 'VARBINARY': binary-varbinary,note 'BLOB': blob. note 'VARCHAR': char, and note 'BLOB': blob, note 'TEXT': blob. and columns only (Using note 'TEXT': blob. these types to store columns very large amounts of data can lower NDB performance)

Replication Support

Asynchronous and Automatic synchronous semisynchronous replication within an replication using NDB Cluster; MySQL Replication; asynchronous MySQL replication between *note Group Replication: group-replication.NDB Clusters, using MySQL Replication (Semisynchronous replication is not supported)

Scaleout for Read Operations

Yes (MySQL Yes (Automatic Replication) partitioning in NDB Cluster; NDB Cluster Replication)

Scaleout for Write Operations

Requires Yes (Automatic application-level partitioning in NDB partitioning Cluster is transparent (sharding) to applications)

High Availability (HA)

Built-in, from InnoDB Yes (Designed for cluster 99.999% uptime)

Node Failure Recovery and Failover

From MySQL Group Automatic (Key element Replication in NDB architecture)

Time for Node Failure Recovery

30 seconds or longer Typically < 1 second

Real-Time Performance

No Yes

In-Memory Tables

No Yes (Some data can optionally be stored on disk; both in-memory and disk data storage are durable)

NoSQL Access to Storage Engine

Yes Yes (Multiple APIs, including Memcached, Node.js/JavaScript, Java, JPA, C++, and HTTP/REST)

Concurrent and Parallel Writes

Yes Up to 48 writers, optimized for concurrent writes

Conflict Detection and Resolution (Multiple Replication Surces)

Yes (MySQL Group Yes Replication)

Hash Indexes

No Yes

Online Addition of Nodes

Read/write replicas Yes (all node types) using MySQL Group
Replication

Online Upgrades

Yes (using Yes replication)

Online Schema Modifications

Yes, as part of MySQL Yes 5.7

 File: manual.info.tmp, Node: mysql-cluster-ndb-innodb-workloads, Next: mysql-cluster-ndb-innodb-usage, Prev: mysql-cluster-ndb-innodb-engines, Up: mysql-cluster-compared

21.2.6.2 NDB and InnoDB Workloads .................................

NDB Cluster has a range of unique attributes that make it ideal to serve applications requiring high availability, fast failover, high throughput, and low latency. Due to its distributed architecture and multi-node implementation, NDB Cluster also has specific constraints that may keep some workloads from performing well. A number of major differences in behavior between the note 'NDB': mysql-cluster. and note 'InnoDB': innodb-storage-engine. storage engines with regard to some common types of database-driven application workloads are shown in the following table::

Differences between InnoDB and NDB storage engines, common types of data-driven application workloads.

Workload note 'InnoDB': innodb-storage-engine.NDB Cluster (note 'NDB': mysql-cluster.)

High-Volume OLTP Applications

Yes Yes

DSS Applications (data marts, analytics)

Yes Limited (Join operations across OLTP datasets not exceeding 3TB in size)

Custom Applications

Yes Yes

Packaged Applications

Yes Limited (should be mostly primary key access); NDB Cluster 7.5 supports foreign keys

In-Network Telecoms Applications (HLR, HSS, SDP)

No Yes

Session Management and Caching

Yes Yes

E-Commerce Applications

Yes Yes

User Profile Management, AAA Protocol

Yes Yes

 File: manual.info.tmp, Node: mysql-cluster-ndb-innodb-usage, Prev: mysql-cluster-ndb-innodb-workloads, Up: mysql-cluster-compared

21.2.6.3 NDB and InnoDB Feature Usage Summary .............................................

When comparing application feature requirements to the capabilities of note 'InnoDB': innodb-storage-engine. with note 'NDB': mysql-cluster, some are clearly more compatible with one storage engine than the other.

The following table lists supported application features according to the storage engine to which each feature is typically better suited.

Supported application features according to the storage engine to which each feature is typically better suited

Preferred application requirements Preferred application requirements for for note 'NDB': mysql-cluster. note 'InnoDB': innodb-storage-engine.

 File: manual.info.tmp, Node: mysql-cluster-limitations, Prev: mysql-cluster-compared, Up: mysql-cluster-overview

21.2.7 Known Limitations of NDB Cluster

In the sections that follow, we discuss known limitations in current releases of NDB Cluster as compared with the features available when using the 'MyISAM' and 'InnoDB' storage engines. If you check the 'Cluster' category in the MySQL bugs database at http://bugs.mysql.com, you can find known bugs in the following categories under 'MySQL Server:' in the MySQL bugs database at http://bugs.mysql.com, which we intend to correct in upcoming releases of NDB Cluster:

This information is intended to be complete with respect to the conditions just set forth. You can report any discrepancies that you encounter to the MySQL bugs database using the instructions given in *note bug-reports::. Any problem which we do not plan to fix in NDB Cluster 7.5 is added to the list.

See Previous NDB Cluster Issues Resolved in NDB Cluster 8.0 (https://dev.mysql.com/doc/refman/8.0/en/mysql-cluster-limitations-resolved.html) for a list of issues in earlier releases that have been resolved in NDB Cluster 7.5.

Note:

Limitations and other issues specific to NDB Cluster Replication are described in *note mysql-cluster-replication-issues::.

 File: manual.info.tmp, Node: mysql-cluster-limitations-syntax, Next: mysql-cluster-limitations-limits, Prev: mysql-cluster-limitations, Up: mysql-cluster-limitations

21.2.7.1 Noncompliance with SQL Syntax in NDB Cluster .....................................................

Some SQL statements relating to certain MySQL features produce errors when used with *note 'NDB': mysql-cluster. tables, as described in the following list:

 File: manual.info.tmp, Node: mysql-cluster-limitations-limits, Next: mysql-cluster-limitations-transactions, Prev: mysql-cluster-limitations-syntax, Up: mysql-cluster-limitations

21.2.7.2 Limits and Differences of NDB Cluster from Standard MySQL Limits .........................................................................

In this section, we list limits found in NDB Cluster that either differ from limits found in, or that are not found in, standard MySQL.

Memory usage and recovery

Memory consumed when data is inserted into an *note 'NDB': mysql-cluster. table is not automatically recovered when deleted, as it is with other storage engines. Instead, the following rules hold true:

 File: manual.info.tmp, Node: mysql-cluster-limitations-transactions, Next: mysql-cluster-limitations-error-handling, Prev: mysql-cluster-limitations-limits, Up: mysql-cluster-limitations

21.2.7.3 Limits Relating to Transaction Handling in NDB Cluster ...............................................................

A number of limitations exist in NDB Cluster with regard to the handling of transactions. These include the following:

 File: manual.info.tmp, Node: mysql-cluster-limitations-error-handling, Next: mysql-cluster-limitations-database-objects, Prev: mysql-cluster-limitations-transactions, Up: mysql-cluster-limitations

21.2.7.4 NDB Cluster Error Handling ...................................

Starting, stopping, or restarting a node may give rise to temporary errors causing some transactions to fail. These include the following cases:

In either of these cases, any errors that are generated must be handled within the application. This should be done by retrying the transaction.

See also *note mysql-cluster-limitations-limits::.

 File: manual.info.tmp, Node: mysql-cluster-limitations-database-objects, Next: mysql-cluster-limitations-unsupported, Prev: mysql-cluster-limitations-error-handling, Up: mysql-cluster-limitations

21.2.7.5 Limits Associated with Database Objects in NDB Cluster ...............................................................

Some database objects such as tables and indexes have different limitations when using the *note 'NDBCLUSTER': mysql-cluster. storage engine:

 File: manual.info.tmp, Node: mysql-cluster-limitations-unsupported, Next: mysql-cluster-limitations-performance, Prev: mysql-cluster-limitations-database-objects, Up: mysql-cluster-limitations

21.2.7.6 Unsupported or Missing Features in NDB Cluster .......................................................

A number of features supported by other storage engines are not supported for *note 'NDB': mysql-cluster. tables. Trying to use any of these features in NDB Cluster does not cause errors in or of itself; however, errors may occur in applications that expects the features to be supported or enforced. Statements referencing such features, even if effectively ignored by 'NDB', must be syntactically and otherwise valid.

Note:

See note mysql-cluster-limitations-transactions::, for more information relating to limitations on transaction handling in note 'NDB': mysql-cluster.

 File: manual.info.tmp, Node: mysql-cluster-limitations-performance, Next: mysql-cluster-limitations-exclusive-to-cluster, Prev: mysql-cluster-limitations-unsupported, Up: mysql-cluster-limitations

21.2.7.7 Limitations Relating to Performance in NDB Cluster ...........................................................

The following performance issues are specific to or especially pronounced in NDB Cluster:

 File: manual.info.tmp, Node: mysql-cluster-limitations-exclusive-to-cluster, Next: mysql-cluster-limitations-disk-data, Prev: mysql-cluster-limitations-performance, Up: mysql-cluster-limitations

21.2.7.8 Issues Exclusive to NDB Cluster ........................................

The following are limitations specific to the *note 'NDB': mysql-cluster. storage engine:

See also *note mysql-cluster-limitations-multiple-nodes::.

 File: manual.info.tmp, Node: mysql-cluster-limitations-disk-data, Next: mysql-cluster-limitations-multiple-nodes, Prev: mysql-cluster-limitations-exclusive-to-cluster, Up: mysql-cluster-limitations

21.2.7.9 Limitations Relating to NDB Cluster Disk Data Storage ..............................................................

Disk Data object maximums and minimums

Disk data objects are subject to the following maximums and minimums:

In addition, when working with NDB Disk Data tables, you should be aware of the following issues regarding data files and extents:

Disk Data tables and diskless mode

Use of Disk Data tables is not supported when running the cluster in diskless mode.

 File: manual.info.tmp, Node: mysql-cluster-limitations-multiple-nodes, Prev: mysql-cluster-limitations-disk-data, Up: mysql-cluster-limitations

21.2.7.10 Limitations Relating to Multiple NDB Cluster Nodes ............................................................

Multiple SQL nodes

The following are issues relating to the use of multiple MySQL servers as NDB Cluster SQL nodes, and are specific to the *note 'NDBCLUSTER': mysql-cluster. storage engine:

Multiple management nodes

When using multiple management servers:

Multiple network addresses

Multiple network addresses per data node are not supported. Use of these is liable to cause problems: In the event of a data node failure, an SQL node waits for confirmation that the data node went down but never receives it because another route to that data node remains open. This can effectively make the cluster inoperable.

Note:

It is possible to use multiple network hardware interfaces (such as Ethernet cards) for a single data node, but these must be bound to the same address. This also means that it not possible to use more than one '[tcp]' section per connection in the 'config.ini' file. See *note mysql-cluster-tcp-definition::, for more information.

 File: manual.info.tmp, Node: mysql-cluster-installation, Next: mysql-cluster-configuration, Prev: mysql-cluster-overview, Up: mysql-cluster