Database as a Service: MySQL in the Cloud

Share this article

With everything hosted in the cloud nowadays, why wouldn’t you host your database in the cloud as well? In this article I will take a look at cloud providers offering MySQL cloud hosting. I will discuss their features, ease of use and price. This article will cover:

  • two providers offering just MySQL in the cloud: ClearDB and Xeround (Xeround is closing down as of May 15th, 2013. Read here).
  • two major cloud providers that offer hosted MySQL as part of their total offering: Amazon RDS for MySQL and Google Cloud SQL.

Features

Even though all providers offer a hosted MySQL database, there are some differences. You will find limitations with:
  • Xeround: Limitation in full MySQL compatibility, like ALTER table functions, log files and more. See release notes. These limitations are mostly in place to make dynamic scalability possible.
  • Google Cloud SQL: Limitation in full MySQL compatibility, and features like user defined functions and MySQL replication. See FAQ.
Amazon RDS for MySQL and Google Cloud SQL are pretty straightforward cloud-based MySQL instances, without much juice to it but with the added benefit of being in the cloud (when it comes to scaling up or down, easy cloning etc.). They simply allow you to host your database in their cloud infrastructure, with the above limitations. Amazon RDS for MySQL also has the option to have a replication standby in case of failure of your main database, and offers automated backups. Selecting one of them depends mostly on which infrastructure you use to run your main applications. Amazon RDS would be the best fit if you host them on EC2 for example, because of low latencies. But the combo isn’t required, you can host a Google Cloud SQL database with an EC2 server. Xeround en ClearDB take it up a notch, by providing high availability (100% uptime), easy backups and geo-distribution. Xeround tops it off with dynamic scalability for keeping up with size and throughput requirements. They both try to make it much easier for you to host your database in the cloud, without worrying about what happens when a node fails. They both run on Amazon AWS, as well as Rackspace Cloud and HP Cloud (Xeround) or Microsoft Azure (ClearDB).

Ease of Use and Specific Functionality

Now let’s have a look at how simple it is for each provider to get your database up and running. Amazon RDS Amazon RDS You launch an Amazon RDS for MySQL instance like any other AWS instance, and within minutes you can access it. It does require you to have an active AWS account. Amazon offers a lot of options like automated backups, Multi-AZ deployment (standby replicated version of your database for fail-over) and Provisioned IOPS (I/O optimization) right from the set up, which is very convenient. Amazon uses a database security group for your database instance, for which you need to authorize your server’s IP. Once it’s done, use your DB instance endpoint as the database server along with the login credentials you specified in your setup, and you’re done. You can also grant access to a specific EC2 security zone. Monitoring is running right away, and gives you insight into usage metrics like CPU, memory, latency etc. You can also set up alarms, to notify you whenever one of these metrics is crossing a specified threshold. Amazon RDS ClearDB ClearDB Setting up ClearDB is literally done in a minute, but has one downside. You can only set it up from one of their partners, being Heroku, Microsft Azure Cloud or Appfog. I’m using the last one, Appfog. But it’s almost as easy with Heroku, where you can connect it with your app. Appfog uses its own environment variables for you to connect to your database with your app/site, which includes the database location and login credentials. ClearDB doesn’t offer much fancy monitoring, just query performance and database growth (MBs). It allows you to make a backup yourself, but it automatically keeps track of the last five days of your database as part of its service. ClearDB
Google Cloud SQL Google Cloud SQL Starting up a Google Cloud SQL database is done from the Google API site, and requires you to have an active account (confirmed with billing).  You spin up a new instance, and choose the settings you like. Google Cloud SQL offers automated replication of your database, where you can choose between synchronous replication (when updating your database you have to wait for replication to finish) or asynchronous replication (you don’t have to wait for update, which is faster but can cause problem with outages during backup). You can connect your database to your Google App Engine app, or from an external resource. They offer a range of options to connect for management (Java based command line tool), or for your application (JDBC). Google Cloud SQL offers all the basic monitoring options, like reads, writes, queries and more. Google Cloud SQL automatically sets up a daily backup, and you can save up to 7 days of backup for free. Google Cloud SQL Xeround Xeround Just like ClearDB you can start up a Xeround database from Appfog and Heroku, but also as a stand-alone service. You simply sign up for Xeround, and add a new database. After a few minutes, it’s running. You will then be given two addresses for you to use as database location. One is internal, for if your site is in the same datacenter as your database, and one is an external address in case you’re hosted elsewhere. Xeround offers four metrics for monitoring, in both numbers and graphs. You can’t make an backup with their free plan, but there’s always an automated copy standby for redundancy. Xeround

Pricing

All providers (currently) provide a free plan: Amazon RDS: Micro DB instance (630 MB RAM) with 20 GB storage, 20 GB backup space and 10M I/Os a month (low IO capacity), as part of their free tier. ClearDB: Free plan offers 5 MB of storage, max. 10 connections, daily backups, low IO performance. Google Cloud SQL
: One cloud instance with a small (unspecified) amount of RAM, 0.5 GB storage and a “reasonable” IO performance (Google intentionally remains vague about what you get: it’s a trial plan). Xeround: Free plan offers 10 MB of storage, max. 5 connections, max. 1 MB/s throughput, and no backups. But what if you run a highly popular, database intensive site? How much would that cost? ClearDB and Xeround work with DB size, max. connections and IO performance, while Google Cloud SQL and Amazon RDS use the traditional instance size (where RAM comes in play). Here are some examples for each of the medium plans: Amazon RDS: Medium DB instance, 3.75 GB RAM, moderate I/O capacity, 5 GB storage, $129,60 per month. ClearDB: Scream DB, database size up to 10 GB, max. 40 connections, high I/O performance, $99.95 per month. Google Cloud SQL: D4, 2 GB RAM, 1.7M I/O per day, 5 GB storage, $175.80 per month. Xeround: PRO, database size up to 3 GB, up to 4,800 connections, unlimited throughput, daily backups, auto-scaling, $453.60 per month. As you can see, Amazon RDS offers the most bang for the buck, but is conservative in guaranteeing I/O performance (although they are rolling out provisioned IOPS storage, which gives you more control of I/O). Google Cloud SQL has this more specified, but offers lower RAM for a higher price than Amazon RDS. A Google Cloud SQL instance will cache your storage in its RAM, reducing I/Os and improving load times. For Amazon RDS you’ll need Amazon ElastiCache, which is a paid service in its own right. ClearDB and Xeround start alike, but differ a lot when more storage is used. To be fair, Xeround does offer a cheaper plan (BASIC), but it’s limited to 0.5 GB storage. This plan costs $17 per month, and ClearDB would cost $9.95 per month for 1 GB storage. And ClearDB has a dedicated environment starting at $399.95 per month, but that doesn’t compare to Xeround since the latter always uses a multi-tenant environment. Xeround PRO has an expensive SLA, and offer auto-scaling. But the price is steep, and is something which can influence your decision even if your database if just a few MBs when you start.

Conclusion

In this article I wanted to give you an impression of what is available in Database-as-a-Service. As with most cloud based services, the possibilities are endless. But Amazon RDS comes off as a good allrounder, with competitive pricing and a whole range of features. You can easily build a high availability database yourself, with automated replication and lots of monitoring options. What helps is that you probably are already at least a bit familiar with Amazon AWS if you’re into cloud computing, and RDS uses the familiar instance methods. Google Cloud SQL provides an impressive offering, but can be a bit harder to set up. It helps if you are already familiar with the App Engine, but since Google Cloud isn’t as widely used as Amazon AWS it has a higher learning curve. They used the experience gained from running Google search to build their infrastructure, so it’s proven and fast. But you do pay the price for this speed. ClearDB and Xeround seem like competitors at first, but they clearly want to distinguish themselves from each other, in both pricing and features. Their starter plans are mostly alike, but Xeround’s PRO plan is in a league of its own. It’s very pricey, but highly reliable and scalable. This doesn’t mean ClearDB isn’t reliable, but their approach is different and they know their limitations (being scalable is what makes Xeround not able to offer the full MySQL package, as described in their limitations at the beginning of this article). They both do make a high availability MySQL database accessible, easy to setup (Xeround more universal than ClearDB) and affordable (if you keep it small), making full use of the cloud’s abilities. And for that achievement, they both are the winners in this comparison.

Frequently Asked Questions (FAQs) about Database as a Service (DBaaS) and MySQL in the Cloud

What are the benefits of using MySQL in the cloud?

MySQL in the cloud offers several advantages over traditional on-premise databases. Firstly, it provides scalability, allowing businesses to easily adjust their database capacity based on their needs. Secondly, it offers high availability, ensuring that the database is always accessible, even in the event of hardware failure. Thirdly, it provides automatic backups, ensuring data safety. Lastly, it reduces the need for in-house IT infrastructure and personnel, resulting in cost savings.

How secure is MySQL in the cloud?

Cloud providers implement robust security measures to protect databases. These include encryption of data at rest and in transit, network firewalls, and access controls. Additionally, many providers offer security monitoring and threat detection services. However, it’s important for businesses to understand their responsibilities in the shared security model of cloud computing and implement appropriate measures on their end.

How does MySQL in the cloud compare to other cloud-based databases?

MySQL is one of the most popular open-source databases and is widely used in the cloud. It’s known for its reliability, ease of use, and compatibility with various platforms. However, other cloud-based databases like PostgreSQL, MongoDB, and Oracle also have their strengths. The choice of database depends on the specific needs and requirements of the business.

Can I migrate my existing MySQL database to the cloud?

Yes, most cloud providers offer tools and services to facilitate the migration of existing databases to the cloud. This includes data transfer services, migration guides, and support from cloud experts. However, it’s important to plan the migration carefully to minimize downtime and ensure data integrity.

What is the cost of using MySQL in the cloud?

The cost of using MySQL in the cloud depends on several factors, including the cloud provider, the size of the database, the required performance, and additional services like backups and monitoring. Most providers offer a pay-as-you-go model, where you only pay for the resources you use. Some also offer free tiers or discounts for long-term commitments.

How does performance in MySQL cloud databases compare to on-premise databases?

Cloud databases can offer comparable or even superior performance to on-premise databases, depending on the configuration and the cloud provider. They benefit from the high-performance infrastructure of cloud providers and can be easily scaled up or down to meet demand. However, factors like network latency and the performance of the application using the database can also affect performance.

What is the role of a Database Administrator (DBA) in managing MySQL in the cloud?

While cloud databases reduce some of the administrative tasks, the role of a DBA is still crucial. They are responsible for tasks like performance tuning, query optimization, security management, and ensuring high availability and disaster recovery. They also need to understand the specifics of managing databases in the cloud, like scaling and cost management.

How do I choose the right cloud provider for MySQL?

Choosing the right cloud provider depends on factors like the performance, security, cost, and additional services offered. It’s also important to consider the provider’s reputation, customer support, and compatibility with your existing systems. Some businesses may also have specific requirements like data sovereignty or compliance with certain regulations.

What are the backup and recovery options for MySQL in the cloud?

Most cloud providers offer automatic backups for MySQL databases, with options to customize the backup schedule and retention period. They also provide services for data recovery in case of data loss or corruption. However, it’s important for businesses to understand the backup and recovery process and ensure they meet their requirements.

Can I use MySQL in a hybrid cloud environment?

Yes, MySQL can be used in a hybrid cloud environment, where some resources are hosted on-premise and others in the cloud. This can provide the benefits of both on-premise and cloud databases, like control over sensitive data and scalability. However, it requires careful management to ensure data consistency and performance.

Jacco BlankenspoorJacco Blankenspoor
View Author

Jacco Blankenspoor is a website developer from the Netherlands, and is currently just building lots of different websites. When he is not working on HIPAAHQ.com you might catch him grinding coffee.

mysql
Share this article
Read Next
Get the freshest news and resources for developers, designers and digital creators in your inbox each week