Chapter 5. Storage: Cloud SQL and Cloud Datastore

The Google Cloud Platform offers two additional storage methods that are very useful for applications running on Compute Engine virtual machines, as well as for applications running outside of Compute Engine. Cloud SQL provides a managed MySQL service, and Cloud Datastore provides a highly scalable, managed NoSQL database in the cloud. We’ll describe both of these services in detail in this chapter and show how to use each mechanism via our three main access methods.

Cloud SQL

Google Cloud SQL offers a cloud-hosted incarnation of the popular MySQL relational database-management system. Unlike traditional MySQL deployments, which can require significant administration skills to back up, replicate, and administer databases, this service is fully managed. Google takes care of updating the MySQL software version, replicating your stored data, and backing up your databases.

Google Cloud SQL originated as an App Engine feature, but it’s since been extended to provide a general hosted relational database service for any application, anywhere. In this section, we’ll walk through the steps to create a Cloud SQL relational database, and we’ll access that database from a Compute Engine instance.

As with other Google Cloud services, Cloud SQL can be accessed in several ways: the Google Developers Console web UI, a command-line tool (gcloud sql), or the native MySQL wire protocol. There are also standard drivers available to access MySQL from ...

Get Google Compute Engine now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.