What is #Google #Cloud #SQL
, its Features and Some #Products
That Have Benefited from It?
In a series of blog posts about Google Cloud and related products, we have already written about #BigQuery
and App Engine. This week we present Google Cloud SQL.
What is Google Cloud SQL?
Using Google Cloud SQL, you can manage and store data using this relational database. Google ensures performance and availability and takes care of database management, patch management and replication. Google Cloud offers a powerful database in the form of Cloud SQL, which provides your app the reliable and redundant storage it requires, along with sufficient space and speed of operation.
SQL instance is quite similar to a server. Several databases can be part of one Cloud SQL instance. It is a MySQL database which resides in Google Cloud. The database has all the functionality and capabilities of #MySQL
, with a number of additional features and a few unsupported features as well. Google Cloud SQL is ideal for small to midsize apps, doesn’t require any maintenance or software installation and is not difficult to use.
To connect to a Google Cloud SQL instance, you can use:
Google Apps Script – lets you develop, configure and utilize relational databases on Google Cloud. Connect to the databases in Apps Script through the special method getCloudSqlConnection.
As Google Cloud SQL is fully managed by Google, you don’t have to be concerned about database management, patch management or replication as Google takes care of it.
Since it uses open source databases that are among the most popular ones worldwide, i.e., MySQL databases, you can develop and deploy quickly. Instances are obtainable up to 500GB storage and 16GB RAM.
You can access and manage instances through a command-line interface or a web console without difficulty. So, Cloud SQL provides you with a fair degree of control.
The pay-per-use option is quite inexpensive. By paying only for the time for which you access data, you save money, especially if you are operating a database used sporadically or lightly. For instances loaded more heavily, you can control costs through the package option.
You can avoid lock-in of data while migrating data on to or off the Google Cloud platform through JDBC, MySQL Wire Protocol and mysqldump, among other tools, besides standard connections.
Failover among the many physical locations where data is replicated is automatic. So, even if there is a major failure, your data is secure and your database is available. Google manages your backups and ensures that it’s not difficult to restore data when required, even if it implies point-in-time delivery.
A few additional features are as follows:
Point-in-time recovery and automated backups
Hosting your MySQL databases in the cloud
Connecting with the secure sockets layer (SSL) protocol
Greater durability and availability of data which is replicated in various geographic locations
Support for MySQL connectors and wire protocol
Availability of instances in Asia, EU and the US
Asynchronous or synchronous replication among various physical locations
Google Cloud SQL doesn’t support user defined functions
It doesn’t support a few MySQL statements
It doesn’t support the SUPER privilege
It doesn’t support the SHA2 () function from MySQL
How Do You Get Started With Cloud SQL?
To get started with Google Cloud SQL, you can:
Create a Google Cloud SQL instance and configure it with an IP address to be able to connect to it.
Use the MySQL client to connect a Google Cloud SQL – install the MySQL client; use the IP address you created to connect to the instance; create a table and a database, key in some data and query it.
Configure a Google Cloud SQL instance – configure access; set a root password; create, delete, restart and edit instances; configure SSL for instances; view information about instances; export or import data; configure point-in-time recovery and schedule backups.
Connect to a Google Cloud SQL instance – from App Engine Go apps; using MySQL client; from App Engine PHP apps; from reporting and admin tools; from App Engine Python apps; from external apps; from App Engine Java apps; from Google Apps Scripts
You can use apps running on Compute Engine and App Engine, in addition to standard tools, to connect to a Google Cloud SQL instance that you have created and configured.
How do you manage your Cloud SQL instances?
Management of Cloud SQL instances involves:
Creating an instance – While creating a Google Cloud SQL instance, the name of the instance is the only configuration setting needed. You can modify or accept the default values for all other settings for the instance.
Editing an instance – You can edit an instance and change its settings at any time after you have created it. The change is applied immediately for all instance settings except for size of the instance. To make changes in the size of an instance, Google Cloud SQL starts and stops the instance automatically for a short period of time. You can’t connect any apps to the instance during that time period. For apps built to handle temporary disruptions to database connectivity, this is generally not a problem.
Restarting an instance – An instance is stopped as all connections from it are drained. Google Cloud SQL restarts the instance when there is a fresh connection request for the instance, until which the instance stays shut. The requirement to restart any instance arises rarely, however.
Deleting an instance – When deleted, the data in an instance is lost permanently and it is a good practice to delete an instance following a scheduled backup or export of the instance.
Configuring SSL for instances – You can use the SSL protocol to connect to a Google Cloud SQL instance. You can configure the instance to be able to connect to it through SSL, once you have created it. All the key files and certificates required for a secure connection are available through the Google Developers Console.
Adding project members – If you are the owner of a project, you may have to add project members who are allowed to manage instances. Use the Google Cloud SDK or the Google Developers Console to add editors and project owners. You have to validate the machine from where you establish a connection, if you choose Google Cloud SDK for connecting. In any given project, the project rights are the same for all the instances associated with that particular project. You should consider the task to be accomplished and provide the minimum level of access required for that. After a member is added, you can alter the permissions assigned to a project any time you wish to.