google cloud sql

Hosting MySQL Databases on Google Cloud SQL

Google Cloud SQL is actually a very good alternative for storing MySQL databases within the Google Cloud. Google has been developing new cloud projects which aims at providing different kinds of service especially big business and corporate houses. The Google Cloud SQL can be used to store and manage data using a relational MySQL database.

One of the biggest advantages of Cloud SQL is that it runs fast which results in faster server side response and it’s reliable which is important for keeping your files intact.

Features

  • The biggest advantage is the familiar infrastructure. It’s based on the relational MySQL database and it’s fast.
  • In terms of reliability, you get security, availability and durability. The data is replicated among several servers which means even in the case of a network failure, data retrieval is possible. In terms of security, the database in encrypted which prevents unauthorized access.
  • The migration process is easy. Tools like mysqldump and JDBC make it easy for different kinds of migration and avoid lock-ins.
  • In terms of pricing, it is very flexible. You can pay according to the time that you use the platform which makes the whole process very economical.
  • Up to 500GB of storage with any size instance

Getting Started with Google Cloud SQL

The first thing that you’re going to have to do is create a new project. To do that, you can go to this link and click on Try Now.

google cloud sql

When you click on Try Now you will be provided with the option of filling up your Project Name and Project ID.

google cloud sql

Once you have done this, you will be taken directly to the project page. On the left side of the page, you will get to see many options like App Engine, Compute Engine, Cloud Datastore, Cloud Storage etc. One of them will be Cloud SQL. You need to select that option.

After that you will need to create an instance.

Creating instance on Cloud SQL

The first thing that you will need to fill up is the instance ID and region. Currently, Google Cloud SQL has only two regions – United States and European Union.

google cloud sql

Then comes Resources and Billing. This is where your pricing and RAM comes in. You are given tiers which basically are RAMs. Higher the RAM, higher the speed and higher the pricing. The lowest D(zero) tier comes with a 128M RAM and it costs $0.025 per hour. The highest D32 tier comes with  a 16GB RAM and costs $3.08 per hour.  The billing plan comes with two options – Per Use and Package. In some cases, Per Use could be more economical because you’re only billed by each hour that the database instance is accessed. In the Package option, the users are charged monthly by the number of days the database instance is accessed.

google cloud sql

Then comes the preferred location on which your database instance is stored. You could also have ‘No Preference’ and Google will take care of that automatically. Remember that Google will create multiple replicas in multiple locations.

Then comes ‘Options’ in which you have the option of choosing the replication method – Synchronous and Asynchronous. Synchronous is more reliable because the writes are slower. Asynchronous replication is very fast and it replicates within seconds. You can also choose the Backup Window which is the time period Google will backup your databases.

google cloud sql

Users are also allowed to Assign IP address that will be used to access the database instance. If you assign one, you will be able to connect to the database instance from external networks with different MySQL tools. Assigning IP address will however cost you an extra $0.01 per hour.

google cloud sql

You can also authorize your App Engine applications to use your database instances. Technically, your database instance will be created to your closest located App Engine applications. You can authorize multiple applications ( see image above ).

Before confirming, make sure your billing is enabled. When you’re done with it, you will be able to create MySQL databases. For more information, check out this link.

Share this post :
Lahaul Seth

Lahaul Seth

Software Engineer, Open Source Enthusiast & Blogger - I also own Lion Blogger Tech which focuses on Open Source, UI, UX, Technology.

I also own Open Source Software News which is a curation site for Open Source Technology News & Updates.

Also check out my personal site.