I recently saw the Planet MySQL post Five months with MySQL Cluster by Brian Moon.
Thought I’d add my 5 cents worth (Australian’s don’t have 1 cent coins any more to make 2 cents worth)
Firstly, it’s great you wrote about your experiences in moving to MySQL Cluster. I think more people should.
Joins
“We used a lot of joins. We learned (later) that joins in the cluster are not a good idea.”
MySQL Cluster’s number one strength is Primary Key Lookups, it’s very good you learned that joins (especially say 5-6-7 table joins) are not a good idea, it is not a strength, and certainly not scalable to thousands of queries per second.
Rewrite
“We rewrote our application (basically, our public web site) to use the new cluster and its new table design.”
It’s great you acknowledged that you had to rewrite your application. I’m sure the attitude of people in the industry is: We need more HA, MySQL offers MySQL Cluster as a HA 5x9s solution, let’s just put out existing application on Cluster. This simply does not provide the results people think, and could in theory result in disaster, particularly when choosing H/W, see next point.
I would expand on a few cases of what you re-wrote, this level of education will help educate the masses.
Hardware
“Six new Dell dual-core, dual processor Opterons with a lot of memory”.
First, MySQL Cluster is an in-memory database, so lots of memory is essential. Second, Data Nodes are a single threaded process, so even with 4 cores your H/W will be underutilized as data nodes.
If an organization wants to say get two 4 CPU Dual Core machines (that’s 2×8 cores per machine), it’s impractical to use as Data Nodes. Far greater performance, reliability and scalability is obtained by having 8×2 core machines. The issue then becomes power consumption and rack space, this is what hurts MySQL Cluster. It’s important to remember MySQL Cluster was designed to run on low commodity hardware, and a lot of it.
“So, we configured the cluster with 4 replicas.”
Interesting. You don’t see many references to more then the default, documented and accepted 2 replicas.
Administration
“MySQL Cluster is a whole new animal.”
Yes it is, an ALL DUMP 1000 for example, and then having to parse log files for the “right” strings needs to be improved for example just to determine memory utilization. You may also want to check out ndbtop. I managed to get an earlier version working, but never really had the time to delve more. Monty also may have some admin stuff of interest buried within his NDB Connectors work.
Conclusions
“What a moron!”
Far from it, I hope your article helps in the education of MySQL Cluster more to the community. I’m certainly going to reference my responses to your article as “key considerations” in considering MySQL Cluster for existing applications.
I would add that with MySQL Cluster you require all equipment to be within a LAN, even the same switch. This is important, MySQL Cluster does not work in a WAN situation. I’ve seen an example H/W provided for a trial Cluster with some machines in a West Coast data center, and some in an East Coast data center.
You also can’t have a lag slave for example as in a Master/Slave environment.
You didn’t mention any specific sizes for data, I’d be interested to know, particularly growth and how you will manage that?
You also didn’t mention anything about Disk? MySQL Cluster may be an in-memory database but it does a lot of disk work, and having appropriate disk is important. People overlook that.
You didn’t mention anything about timings? Like how does backups for example compare now to previously.
You didn’t mention version? 5.1 (not GA) is significant improvement in memory utilization due to true varchar support, saving a lot of memory, but as I said not yet production software.
Brian Moon says
“so even with 4 cores your H/W will be underutilized as data nodes.”
Well, to address 8GB or RAM, Dell required a Dual processor machine. We knew that going in. From what I understood at MySQL Conference, there is highly experimental work on threaded ndb. Of course, when that is ready, these servers will see the end of their life.
I will update my post with follow ups to your questions.
Lukas says
Couldnt you put multiple data nodes on one physical server to better leverage the multi core CPUs?
Monty Taylor says
In theory, yes, you could physically place multiple data nodes on one physical server, but it is both impractical and not recommended for a couple of reasons. First, the high memory requirements of mean you will be placing yourself into extremely high amounts of memory on the box, where a whole other box might be cheaper than doubling the memory on the one box. Also, although it doesn’t get much press, NDB needs a good amount of disk bandwidth, so you are also unlikely to have enough of that. Those hurdles overcome, you are still setting yourself up for a situation where if a single machine fails, you aren’t dealing with just one node failure, you are dealing with multiple simultaneous failures, which isn’t very well tested.