This document describes how to use Google Cloud SQL instances with the App Engine Go SDK.
To learn more about Google Cloud SQL, see the Google Cloud SQL documentation.
If you haven't already created a Google Cloud SQL instance, the first thing you need to do is create one.
Creating a Cloud SQL Instance
A Cloud SQL instance is equivalent to a server. A single Cloud SQL instance can contain multiple databases. Follow these steps to create a Google Cloud SQL instance:
- Sign into the Google Developers Console .
- Create a new project, or open an existing project.
- From within a project, select Cloud SQL to open the Cloud SQL control panel for that project.
-
Click
New Instance
to create a new Cloud SQL instance in your project, and configure your size, billing and replication options.
- More information on Cloud SQL billing options and instance sizes
- More information on Cloud SQL replication options
That's it! You can now connect to your Google Cloud SQL instance from within your app, or any of these other methods .
MySQL case sensitivity
When you are creating or using databases and tables, keep in mind that all identifiers in Google Cloud SQL are case-sensitive. This means that all tables and databases are stored with the same name and case that was specified at creation time. When you try to access your databases and tables, make sure that you are using the exact database or table name.
For example, if you create a database named PersonsDatabase, you will not be able to reference the database using any other variation of that name, such as personsDatabase or personsdatabase. For more information about identifier case sensitivity, see the MySQL documentation.
Size and access limits
The following limits apply to Google Cloud SQL:
Google App Engine Limits
Google App Engine applications are also subject to additional Google App Engine quotas and limits. Requests from Google App Engine applications to Google Cloud SQL are subject to the following time limits:
- All database requests must finish within the HTTP request timer , around 60 seconds .
- Offline requests like cron tasks have a time limit of 10 minutes.
- Backend requests to Google Cloud SQL have a time limit of 10 minutes.
- Each App Engine instance cannot have more than 12 concurrent connections to a Cloud SQL instance.
App Engine-specific quotas and access limits are discussed on the Quotas page.