Posts

MySQL NDB Cluster Installation Through Docker

Image
In this post, we will see how to setup MySQL NDB Cluster from a docker image. I assume that the reader has some basic understanding of docker and its terminology. Steps to install MySQL NDB Cluster: Let's create a MySQL NDB Cluster with the following environment: MySQL NDB Cluster version (Latest GA version) 1 Management Node 4 Data Nodes 1 Mysqld Server Configuration slots for upto 4 additional API nodes  Note: Docker software must be installed and running on the same host where we are planning to install MySQL NDB Cluster. Also make sure we have enough resources allocated to docker so that we shouldn’t face any issues later on. Step 1: Get the MySQL NDB Cluster docker image on your host Users can get the MySQL NDB Cluster image from github site ( link ). Then select your required cluster version for download. Note: By default MySQL NDB Cluster 8.0 GA version image docker will pull or by mentioning tag:latest also point to latest cluster image which is 8.0 at the moment. If us

Table Partitioning In MySQL NDB Cluster And What’s New (Part IV)

Image
Whats new in NDB Cluster 8.0 version (8.0.23) With new configuration variables introduced in NDB cluster version 8.0.23, user now have more control in table partitioning. Below are the new config variables that can influence the table partitioning scheme: PartitionsPerNode ClassicFragmentation PartitionsPerNode: In earlier cluster versions, the default number of table partitions is based on the number of LDM threads running on a node multiplied by the number of data nodes in the cluster. User can not set any random values to MaxNoOfExecThreads (#LDM) rather the value should be less than or equal to NoOfFragmentLogParts. With cluster version 8.0.23, user can have many no of LDM threads assign to a data node. The rationale is: - Having many LDMs allows a data node to make good use of modern hardware. - Having one partition per LDM per node gives good balance. - However having many partitions can affect range scan scalability and performance, so the number of partitions per table should b

Table partitioning in MySQL NDB Cluster and what’s new (Part III)

Image
Whats new in NDB Cluster 7.5 version (Contd.) In cluster 7.5 the READ_BACKUP and FULLY_REPLICATED table features were added. These features are both designed to improve read performance and scalability, and can be set on a per-table basis. These features are fully implemented inside MySQL Cluster, and tables using these features support all of the normal MySQL Cluster features - secondary unique and ordered indexes, foreign keys, disk resident columns, replication etc. The read performance improvements do not require any special effort to take advantage of – MySQL Cluster automatically chooses the most efficient way to execute reads, whether issued over NdbApi, or via SQL, executed in MySQLD or pushed down for parallel execution in the data nodes. READ_BACKUP: Prior to 7.5, all Committed Read operations were routed to a primary replica of the table or index fragment to be read. The READ_BACKUP feature enables Committed Read operations to be routed to any replica (primary or backup role

Table Partitioning In MySQL NDB Cluster And What’s New (Part II)

Image
Whats new in NDB Cluster 7.5 version In this version, users have more flexible ways of table partitioning rather than the default way thru ldm. Now user can partition the table either by node or by ldm. There are 4 different ways of table partitioning supported, these are: FOR_RP_BY_NODE FOR_ RA_BY_NODE FOR_RP_BY_LDM ( Default) FOR_RA_BY_LDM FOR_RA_BY_LDM_X_2 FOR_RA_BY_LDM_X_3 FOR_RA_BY_LDM_X_4 From the above RA is for Read from any replica i.e either from Primary replica or backup replica and RP is for Read from Primary replica only. The above options user can give either thru create table or from alter table sql statement in the COMMENT section like below. mysql> create table t1(col1 int unsigned not null primary key AUTO_INCREMENT, col2 int unsigned not null, col3 char(255)) engine=ndbcluster COMMENT="NDB_TABLE=PARTITION_BALANCE= FOR_RP_BY_NODE "; OR mysql> alter table t1 COMMENT="NDB_TABLE=PARTITION_BALANCE= FOR_RA_BY_NODE"; The FOR_RA and FOR_RP exist be