Magento on mysql cluster
Just for fun I tried to setup magento on mysql cluster. I already had cluster setup from one of my previous projects, but if you would like to install from scratch here is useful howto: http://dev.mysql.com/tech-resources/articles/mysql-cluster-for-two-servers.html
I tried following way:
1. Create a default installation of Magento 1.1.1 with InnoDB and Myisam tables
This part went OK
2. Dump the whole database, convert InnoDb and Myisam tables to NDBCLUSTER within sql source file
That went OK
3. Import converted sql
That is when the trouble started:
I had to raise DATA memory to 700 MB
Number of attributes had to be raised - 5000 seems ok
Number of Ordered and Hash Indexes had to be raised
So for the cluster.ini:
[NDBD DEFAULT]
DataMemory=700M
IndexMemory=80M
UndoIndexBuffer=64M
RedoBuffer=64M
MaxNoOfAttributes=5000
MaxNoOfOrderedIndexes=1024
MaxNoOfUniqueHashIndexes=512
There are also problem tables with following errors due to the ndbcluster table limitations:
- record too long
- row size too large
This error can be resolved in two ways:
- split the table into two or more
- convert some of the varchar fields into text
I tried the later approach, and had to change the several tables:
-EAV_attributes(one change)
-sales_flat_quote
-sales_flat_quote_address
-sales_flat_quote_address_item
Another problem:
appcodecoreMageAdminModelMysql4Acl.php returns different order on different installations:
$rolesArr = $this->_read->fetchAll("select * from $roleTable order by tree_level “);
Solution: http://www.magentocommerce.com/boards/viewthread/15556/
Conclusion
I didn’t do extensive testing, but it basically works. I guess there could be some troubles with transactions since ndbcluster has its limitations regarding transaction isolation level.
As a suggestion - it would be really cool if development team would consider ndbcluster engine limitations regarding the record length and row size while planning the database model.

