Re: MySQL Cluster (NDB) spread data (rows) to 4 data-nodes servers
Hi Ali
This looks like the question I answered on stack overflow, please accept that if it helped (https://stackoverflow.com/a/77605427/3504629). I duplicate that answer below for otheres to see.
## Row spread
Yes, by using 4 data nodes (ndbmtd) and NoOfReplicas=1 you will have a 4 node groups and the rows will be spread out over the four nodes, and each row will only be on one data node.
Worth mention for others reading this answer is that using NoOfReplicas=1 will not allow reconfiguring or upgrading the data nodes will cluster is online, also will cluster go off line if any of the nodes fail. In short the high availability properties that NDB Cluster supports are suppressed.
## 8 partitions
By explicitly create 8 partitions (for example by using PARTITION BY KEY() PARTITIONS 8) you will get 8 partitions, 2 on each data node.
Using an explicit partition count is not recommended. There is typically no gain doing that, and it does not support reorganize the partitions if one later decides to add more data nodes.
It is recommended to use the default partitioning, that is not using any partitioning clause at all. That will deduce the number of partitions from the cluster configuration. For example if a data nodes uses several threads the number of partitions will increase to match the number of so called LDM threads in the data nodes.
## NDB vs InnoDB
NDB is by design a distributed database system and the application would not need to know about the distribution.
In front of the NDB cluster one can have one MySQL server (mysqld) or more. If more than one are used application can still read and write any row from any of the MySQL servers. For InnoDB you need 4 MySQL servers and application need to know which server have which row and need to connect to the right server to access a row.
With NDB cluster transactions are distributed that may access rows from different data nodes. For InnoDB application would need to use XA transactions.
Regards,
Mauritz
Subject
Views
Written By
Posted
349
December 02, 2023 08:12AM
Re: MySQL Cluster (NDB) spread data (rows) to 4 data-nodes servers
221
December 05, 2023 01:19PM
Sorry, only registered users may post in this forum.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.