MySQL Blog Archive
For the latest blogs go to blogs.oracle.com/mysql
MySQL NDB Cluster replication: Introduction

MySQL NDB Cluster is a distributed database that makes it possible to have more than two hundred MySQL servers operating on the same data, forming a scalable and high-performing cluster where data can be read and written by a large number of clients at the same time.

Using the standard MySQL replication mechanism, data can be asynchronously replicated to or from another MySQL NDB Cluster, a standalone MySQL Server, or MySQL Heatwave. This is all done using well-known tools and familiar commands while at the same time achieving the high performance and redundancy required by a high-availability database such as MySQL NDB Cluster.

Logical view of four clusters replicating using active-active merge replication.
Figure 1. Logical view of four clusters replicating using active-active merge replication.

 

In MySQL NDB Cluster replication it’s possible to read and write data from any MySQL Server regardless of which cluster it’s connected to. This is what we refer to as active-active replication where data is replicated in all directions and conflict detection is used to handle when data occasionally has been updated in more than one cluster at the same time. This is a unique feature that enhances the MySQL replication mechanism and makes it possible to build advanced replication configurations.

For high performance the asynchronous replication will group changes into large epoch transactions, thus allowing efficient batching and execution of transactions in parallel on all data nodes in the cluster. Each such epoch transaction contains an identifier which uniquely identifies the transaction in the cluster where it originated; the identifier is used for positioning when replication need to be restarted.

MySQL NDB Cluster replication is actively used in many different mission-critical solutions, both for replicating data between clusters on the same continent as well as in different parts of the world. This makes it possible to locate a read-write cluster close to the end-user for low latency, while at the same time providing highly functioning disaster continuity with minimal disruption.

The MySQL NDB Cluster replication has evolved over the years in order to fit more and more use cases. The most recent feature added in 8.0.33 is support for the multi threaded applier (MTA). This complements NDB's ability to execute transactions in parallell on the data nodes by also performing parallel unpack, define and prepare in the replica MySQL Server. This functionality allows better utilization of available resources and is especially useful in situations where the replica need to catch up with the source.

 

Showing that NDB multi threaded applier has applied rows to replica cluster
Figure 2. Screenshot showing how the multi threaded applier workers and coordinator have applied changes to a NDB replica cluster.

 

In the following articles we will describe the basic single-channel replication setup, the high-end active-active circular replication or advanced merge replication setups. Over time we will be explaning the basic concepts, advanced use cases as well as the individual features and what they bring.

 

Summary

Data can be replicated from one MySQL NDB Cluster to another by using well-known and proven MySQL replication technology. When replicating to and from MySQL NDB Cluster additional functionality is builtin to enhance the standard MySQL replication features.

 

More information

For more details on how to configure replication see:

MySQL NDB Cluster is open-source and can be downloaded both in source and binary form at MySQL Downloads, there you find the proven GA version 8.0, our just released 8.4 LTS version as well as our innovation releases.

The source code is also available at the MySQL Server repository on GitHub and is frequently used by universities when studying the inner details of advanced high-performance distributed databases. Go explore the source yourself and why not submit a pull request with enhancements!