MySQL, MariaDB and Databases in the Cloud

There's definitely more and more buzz on and around cloud computing and different solutions to support it nowadays!

This was evident while visiting LinuxCon/CloudOpen in San Diego a few weeks ago, where I spoke about high availability solutions for MySQL. Most cloud sessions were highly attended, and I could sense an excitement in the air with regards to the cloud. It was also evident, however, that there is only a small percentage of people today truly taking advantage of the cloud. It seems that despite all the excitement, there is a large portion of potential users who don't know how to use the cloud, or what the benefits and potential drawbacks are.

I am not going to go through all the potential advantages and disadvantages with the cloud here, but there are resources there that do this well, such as this recent blog post, or this one. But the main advantages of computing in the cloud is elasticity and ease of use, to a certain extent.

You do have to give up some control, however. You don't control the hardware you're running on, the network between your machines and so forth. While this is true for applications in general, it is somewhat different for storage, and databases in particular. Spinning up multiple instances of a web server makes it easy to be elastic, however things are no longer so black and white when it comes to storing the actual information.

If you want true elasticity (write scaling) from your data storage or database, you need to somehow partition or shard the data. This in itself is not trivial, and it is most often combined with performance penalties when combining results from multiple shards, unless you limit the complexity of the potential queries. The complexity of the problem grows exponentially if you allow true elasticity - i.e., both growing and shrinking the number of nodes. This means that your data needs to be redistributed and re-partioned each time a node is added or removed from the "cluster".

An easier solution to this problem is to run multiple instances containing the same amount of data. This solution will not provide true write elasticity, but will allow you to scale reads across your database nodes.

This is also what the early version of the SkySQL™ Cloud Data Suite provides. It is based on MariaDB and enables the user to deploy open source databases in the cloud that are 100% MySQL-compatible. It currently allows you to configure a setup with up to 2 database nodes (more are being added as I write this) and sets up replication and automatic failover between these nodes. Having just-read scalability, of course, has its limits. The database must fit in its entirety on each node, the replication has to be flawless and so forth, but it is good enough for most use cases. I urge you to check out the SkySQL Cloud Data Suite configurator and try it out. It currently runs on AWS, but other cloud providers are likely to be added later.

If you are more of a hardcore database user (or just have experience running databases yourself) and are interested in the pros and cons of running MySQL (or MariaDB) and its derivatives in the cloud vs. running it on bare metal, we have also created a training course on this subject.

The training course goes much deeper in running the databases on the cloud, as well as the advantages, drawbacks and potential pitfalls. It covers multiple cloud providers and all the most common MySQL flavors, and shares the most efficient ways of running MySQL in the cloud. Check out the detailed description here.

As the saying goes, "Give a man a fish, and you feed him for the day. Teach him how to fish, and he can feed himself for life.” Having the skills yourself will allow you to go beyond what any tool can do!

Max is the creator of the original MySQL training program at MySQL AB. He is a co-founder of SkySQL and now manages the training department with the aim to help advance the MySQL ecosystem around the world.

Join the conversation
Twitter: @skysql / Facebook / LinkedIn