MySQL Cluster
MySQL Cluster (NDB Cluster) is Oracle's distributed database designed for applications that require linear scalability and 99.999% availability.
Publisher review
MySQL Cluster (NDB Cluster) is Oracle's distributed database designed for applications that require linear scalability and 99.999% availability. It targets real-time, high-throughput workloads such as telecommunications, online gaming, and financial services where downtime is unacceptable. The cluster stores data primarily in memory for low-latency access while maintaining transactional consistency across partitioned datasets. It is best suited for organizations that need a single database to handle both relational and NoSQL access patterns, with active-active geographical replication across multiple sites. MySQL Cluster is not a general-purpose replacement for standalone MySQL; it is a specialized product for users who must scale writes horizontally and survive node failures without manual intervention.
MySQL Cluster achieves high availability by maintaining up to four synchronous replicas of every dataset, ensuring no single point of failure. A single cluster can store over 100 TB of data and scale to hundreds of nodes. It uses a shared-nothing architecture where data is automatically partitioned across nodes, and each node is aware of data locality, minimizing network hops. The parallel distributed query engine allows complex queries to be executed across partitions concurrently. Online scaling and schema upgrades are supported without taking the cluster offline, which is critical for 24/7 operations. The cluster also supports multi-site active-active replication, enabling disaster recovery across geographically separated data centers.
In the MySQL clustering market, MySQL Cluster competes directly with Amazon Aurora, Galera Cluster, InnoDB Cluster, and third-party tools like ClusterControl. Amazon Aurora offers similar high availability but is limited to a single writer node and does not support the same level of horizontal write scaling. Galera Cluster provides multi-master replication but lacks the integrated distributed query engine and data locality features of NDB Cluster. InnoDB Cluster is simpler to set up but does not match NDB Cluster's ability to handle over 100 TB or provide 99.999% availability. MySQL Cluster is also priced per server socket, which can be cost-effective for high-core-count servers compared to per-core licensing from competitors like Microsoft SQL Server or Oracle Database.
The honest trade-offs with MySQL Cluster are significant. It lacks advanced features like full-text search and partial indexes, which limits its use for content-heavy applications. Commands can occasionally be buggy, and server response times may be slower than single-node MySQL for simple queries due to distributed coordination overhead. Historically, it has weaker support for full ACID compliance and sophisticated query optimization compared to PostgreSQL or Oracle Database. Scaling up with complex queries and very large databases can be challenging, and additional backup services are often required because native backup tools are limited. Organizations must weigh the need for extreme availability and horizontal scalability against these operational and feature constraints.
How it works
-
Linear scalability
Supports up to 100 TB in a single cluster by automatically partitioning data across hundreds of nodes.
-
High availability with replicas
Maintains up to 4 synchronous replicas of each dataset, enabling 99.999% availability and zero-downtime maintenance.
-
In-memory real-time access
Stores data primarily in memory for low-latency reads and writes while ensuring transactional consistency.
-
Parallel distributed query engine
Executes complex queries across partitions concurrently, leveraging data locality to reduce network overhead.
-
Multi-site active-active replication
Supports geographical replication between clusters, allowing active-active configurations for disaster recovery.
-
Online scaling and schema upgrades
Adds nodes or modifies schema without taking the cluster offline, critical for 24/7 production environments.
-
Blended relational and NoSQL APIs
Provides both SQL and NoSQL access (e.g., Memcached, NDB API) from the same distributed dataset.
Strengths and trade-offs
Strengths
- Supports up to 4 synchronous replicas of data, enabling 99.999% availability without single points of failure.
- Can store over 100 TB in a single cluster while maintaining in-memory real-time access and transactional consistency.
- Offers online scaling and schema upgrades, allowing nodes to be added or schema changed without downtime.
- Provides a parallel distributed query engine with built-in data locality awareness, reducing network hops for partitioned queries.
Trade-offs
- Lacks advanced features like full-text search and partial indexes, limiting its suitability for content-heavy applications.
- Commands can occasionally be buggy, and server response times may be slower than single-node MySQL for simple queries.
- Historically weaker support for full ACID compliance and sophisticated query optimization compared to PostgreSQL or Oracle Database.
- Scaling up with complex queries and very large databases is challenging, and additional backup services are often required.
Pricing context
Priced per server socket via annual subscription: Cluster CGE (1-4 sockets) at $10,700/server/year; Cluster CGE (5+ sockets) at $21,400/server/year. Community Edition is free under GPL.
Getting started with MySQL Cluster
-
Download and install MySQL Cluster
Download the MySQL Cluster software from Oracle's website. Choose the Community Edition for free use or the Cluster CGE for production. Install the management, data, and SQL nodes on separate servers following the official documentation.
-
Configure the cluster nodes
Edit the config.ini file on the management node to define data nodes, SQL nodes, and replication settings. Specify the number of replicas (up to 4) and partition count. Restart the management node to apply changes.
-
Start the cluster and verify connectivity
Launch the ndb_mgmd management daemon, then start ndbd on each data node and mysqld on each SQL node. Use the ndb_mgm client to run the 'show' command and confirm all nodes are connected and operational.
-
Create a database and load sample data
Connect to a SQL node using the MySQL client. Create a database with the ENGINE=NDBCLUSTER option. Insert sample rows into a table and run a SELECT query to verify distributed storage and retrieval across nodes.
-
Set up monitoring and backup
Configure ndb_mgm to log cluster events and set up alerts for node failures. Use the ndb_restore tool to create backups from a data node. Schedule regular backups using cron or a similar scheduler.
Frequently Asked Questions
What is MySQL Cluster and what is it used for?
MySQL Cluster is Oracle's distributed database designed for applications needing linear scalability and 99.999% availability. It targets real-time, high-throughput workloads like telecommunications, online gaming, and financial services where downtime is unacceptable. It stores data primarily in memory for low-latency access.
How does MySQL Cluster achieve high availability?
MySQL Cluster maintains up to four synchronous replicas of every dataset, ensuring no single point of failure. This enables 99.999% availability and zero-downtime maintenance. The shared-nothing architecture automatically partitions data across nodes, with each node aware of data locality to minimize network hops.
How does MySQL Cluster compare to Amazon Aurora?
Amazon Aurora offers similar high availability but is limited to a single writer node and does not support the same level of horizontal write scaling as MySQL Cluster. MySQL Cluster provides multi-site active-active replication and can scale writes across hundreds of nodes, making it better for extreme scalability needs.
What are the main trade-offs of using MySQL Cluster?
MySQL Cluster lacks advanced features like full-text search and partial indexes, limiting its use for content-heavy applications. Commands can be buggy, and simple queries may be slower than single-node MySQL due to distributed coordination overhead. It also has weaker ACID compliance and query optimization compared to PostgreSQL.
How is MySQL Cluster priced?
MySQL Cluster is priced per server socket via annual subscription. Cluster CGE for 1-4 sockets costs $10,700 per server per year, and for 5+ sockets it costs $21,400 per server per year. A free Community Edition is also available under the GPL license.
Can MySQL Cluster handle both relational and NoSQL workloads?
Yes, MySQL Cluster provides both SQL and NoSQL access from the same distributed dataset. It supports APIs like Memcached and NDB API alongside standard SQL, allowing applications to use relational or NoSQL patterns as needed while maintaining transactional consistency across partitions.
Alternatives
How MySQL Cluster compares
Direct head-to-head against 3 competitors. Picked by 7wData.
MySQL Cluster
- Pricing
- Priced per server socket via annual subscription: Cluster CGE (1-4 sockets) at $10,700/server/year; Cluster CGE (5+ sockets) at $21,400/server/year. Community Edition is free under GPL.
- Target
- MySQL Cluster (NDB Cluster) is Oracle's distributed database designed for applications that require linear scalability and 99.999% availability.
- Strength
- Supports up to 4 synchronous replicas of data, enabling 99.999% availability without single points of failure.
- Watch for
- Lacks advanced features like full-text search and partial indexes, limiting its suitability for content-heavy applications.
AWS Aurora MySQL
- Pricing
- $59.86/month (db.t4g.medium)
- Target
- Enterprise workloads
- Deployment
- Cloud
- Strength
- High availability, advanced features
- Watch for
- Significantly higher cost than alternatives
Google Cloud SQL
- Pricing
- $11.32/month (db-f1-micro)
- Target
- Developers, SMBs
- Deployment
- Cloud
- Strength
- Low entry cost, free tier
- Watch for
- Limited scalability at lower tiers
PlanetScale
- Pricing
- $39/month (1/8 vCPU, 1 GiB)
- Target
- Developers, startups
- Deployment
- Cloud
- Strength
- Git-like branching, non-blocking schema changes
- Watch for
- Recent pricing changes, limited free tier
User reviews
No user reviews yet. Be the first to write one.
Sources
Reporting on this tool draws on these publicly available sources.