MySQL Cluster IaaS best practices for Azure – High Availability, Fault Tolerance, Scalability
MySQL集群的最佳实践–Azure的IaaS的高可用性、容错性、可扩展性
Introduction
MySQL Cluster, if used correctly, has proven to be one of the most fault tolerant, scalable and real-time distributed Active/Active-capable enterprise data storage solutions. Web providers with tons of daily visits like Paypal and Zillow, as well as leading telecommunications and network equipment providers, including Alcatel-Lucent, AT&T, BT, and Ericsson have successfully deployed MySQL Clusters. You can listen to Paypal Chief Architect talk about using MySQL cluster for Paypal fraud detection in this video . They use the MySQL Cluster Carrier Grade Edition (“CGE”) which includes support and useful enterprise tools – but the MySQL Cluster Community edition is free to try out and play around with.
So why another best practices guideline for MySQL Cluster? Because when it comes to deploying and getting the best out of MySQL on Azure as an IaaS solution, we have to keep certain things in mind that is not necessarily covered very well out there today. Oracle has a whitepaper that is intended to be on the topic of MySQL for cloud – it is called “A Guide to MySQL for SaaS”. However, I found that it is more of a marketing material than being a technical guide. Also, it covers all MySQL offerings broadly, and none very deeply, including MySQL Cluster.
Which brings me to the distinction, MySQL Cluster is not the same asMySQL Database (which, in short, is just “MySQL”). They do not follow the same release cycle and version number patterns. As of this blog post, the GA version of MySQL Cluster is 7.4, but the GA version of (simply) MySQL is 5.7. MySQL Cluster does not use the same engine as MySQL – it uses a different engine called “NDB Cluster”. MySQL Cluster does not store the data co-located with the mysqld daemon, it uses separate data nodes. It is a very different beast in that sense. Of course, it is still the same in one sense, but the difference is important to note for this blog post, because we are going to explore MySQL Cluster on Azure. On the contrary, this article and this blog post of mine deals with certain best practices of using MySQL on Azure.
PaaS versus IaaS MySQL Cluster for Azure
ClearDB now provides PAAS MySQL Clusters on Azure as well. In fact, their offering seems very robust and technically a lot more attractive than managing your own instances of MySQL Clusters because of therecently announced option of Premium Dedicated Clusters.
I say that because personally, PaaS is always more attractive than IaaS, because you do not have to worry about maintaining/ monitoring/ upgrading your infrastructure, you do not have to worry about the up-time SLA or handle scaling your VM-s yourself. However, I am not sure of how ClearDB stacks up against Azure IaaS cost-wise. Though I have not done an accurate cost comparison analysis between these choices, it is clear to me that MySQL Cluster demands Azure VM-s of bigger sizes because of its memory needs. Therefore, none of the options promise to be cheap, but I am sure both of them are cheaper than having on-premises servers which tend to be severely under-utilized and almost always end up having a higher TCO because of man-hours spent in maintaining these servers, money spent behind refreshing hardware, etc.
This blog post is about IaaS – where you set up the MySQL Cluster yourself on Azure. I wrote another blog post about the actual process of creating a MySQL Cluster on Azure. I will not cover the same here again. This one will be about architectural best practices regarding high availability, fault tolerance and geo-replication.
What about Performance?
Today, we will cover High Availability, Fault Tolerance, Scalability and some thoughts on Geo Replication related to MySQL Cluster on Azure. We will leave the performance for another day. Why? A few thoughts:
There are a lot of articles on the internet that focuses on performance optimization, fine tuning and cluster configuration for optimum MySQL cluster performance. Most of these techniques are specific to MySQL Cluster and will work regardless of where it is running – on-premises or cloud, AWS or Azure. However, in my opinion, HA and Fault Tolerance aspects are different on the cloud, and need special considerations.
You will hear a lot of great things about MySQL Cluster performance. Sometimes it gets difficult to sieve through results published by people trying to sell something versus people stating facts in a blunt way. Not every product is suitable for every use case. You get a feature at the cost of another, trade-offs are made – but these trade-offs are sometimes not discussed openly. What is the trade-off involved with MySQL Cluster? This is a quote from an official MySQL Cluster white paper: “MySQL Cluster is a distributed, shared-nothing data store that provides very high, scalable performance for applications that largely use pri