Google Cloud SQL is a managed Google Cloud database service that allows you to run MySQL, PostgreSQL and Microsoft SQL Server databases on Google Cloud.
In this post, we’ll give you a well-rounded introduction to the service, explaining what Google provides for each type of database, the costs, and how to start your first database. In addition, we’ll show how NetApp Cloud Volumes ONTAP can help optimize and reduce costs for database storage on Google Cloud.
In this article, you will learn:
Google Cloud SQL is a fully-managed service that you can use for relational databases in Google Cloud. It is compatible with SQL, MySQL, and PostgreSQL and can be connected to almost any application. The service provides automated backups, replication, and failover to ensure high-availability and resilience. It provides an easy and fast way to deploy and operate an SQL database in your cloud.
Features of Google Cloud SQL include:
When deciding which database type is best suited for your needs, it’s helpful to understand how your options compare. Below is a breakdown of some of the most important differences.
MySQL |
PostgreSQL |
SQL Server |
|
Description |
MySQL Community Edition |
PostgreSQL based on the Cloud SQL Second Generation platform. |
Standard SQL Server |
Resources |
Instances support v5.6 and up with up to 416 GB RAM and 30 TB storage. These instances can be autoscaled. |
Custom instances provide up to 416 GB RAM, 64 CPUs, and 30 TB of storage. These instances can be autoscaled. |
Custom instances provide up to 416 GB RAM, 64 CPUs, and 30 TB of storage. These instances can be autoscaled. |
Can be used |
|
|
App Engine applications only |
Google Cloud SQL has a different pricing model for each database service.
Google Cloud SQL server pricing
Google Cloud MySQL second-generation pricing
Google Cloud PostgreSQL pricing
Setting up an SQL instance is relatively straightforward. You can follow the tutorial below to set up a MySQL instance. If you wish to set up PostgreSQL or SQL instead, you can follow the Google tutorials linked here.
1. Setup and requirementsTo get started, you need to have a Google Account. If you don’t have one, you need to first create one. Next, you need to sign into the Google Cloud Platform Console and create a new project. In the console, you also need to enable billing so you can use cloud resources.
2. Open the Cloud SQL web UIIn the console side menu, select SQL from the Storage subsection.
Source: Google
This brings up the Cloud SQL user interface. Since you are starting a new project, you should see a dialog box that you can use to create a new SQL instance.
3. Create a new instance
Select the Create instance button. Previously, there were two instance types you could choose for MySQL. Now, only second-generation instances are available. If you have existing first-generation instances, you can leave instances as is or upgrade. However, any new instances you create must be second-generation.
Source: Google
In the creation screen, you are prompted to enter details for your instance. These details include:
Once you have entered your details and recorded your password in a safe location, click Create. This returns you to the instances list where you can select your instance to see its details. Note that instance initialization and startup typically take a few minutes to complete.
4. Create a database with Cloud ShellOnce your instance is ready, you can connect to it and create your database. To do this, in the console, click the Activate Google Cloud Shell button.
Source: Google
Since this is a new project, you need to click Start Google Shell when prompted. Once the shell pops up, you can connect to your instance with the following command:
gcloud sql connect {Instance name} --user=root
You should be prompted to enter your root password. Once entered, you can create your database with the following command:
After database creation, you can begin entering or importing data as needed.
NetApp Cloud Volumes ONTAP, the leading enterprise-grade storage management solution, delivers secure, proven storage management services on AWS, Azure and Google Cloud. Cloud Volumes ONTAP supports up to a capacity of 368TB, and supports various use cases such as file services, databases, DevOps or any other enterprise workload, with a strong set of features including high availability, data protection, storage efficiencies, Kubernetes integration, and more.
In particular, Cloud Volumes ONTAP helps in addressing database workloads challenges in the cloud, and filling the gap between your cloud-based database capabilities and the public cloud resources it runs on.