To store data and files on App Engine, you can use Google Cloud services or any other storage service that is supported by your language and is accessible from your App Engine instance. Third-party databases can be hosted on another cloud provider, hosted on premises, or managed by a third-party vendor.
Google Cloud storage services
For App Engine apps running in the Python 2 standard environment, we recommend one of the following Google Cloud storage services:
Name | Structure | Consistency | Cost |
---|---|---|---|
Firestore in Datastore mode | Schemaless (NoSQL) | Strongly consistent except when performing global queries. | Datastore mode offers a free quota with daily limits. Paid accounts offer unlimited storage, read, and write operations. More information is available on the Datastore Quotas page. |
Cloud SQL for MySQL or Cloud SQL for PostgreSQL |
Relational | Strongly consistent | Google offers two billing plans for Google Cloud SQL: packages and per use. More information is available in the Cloud SQL price sheet. |
Cloud Storage | Files and their associated metadata (Cloud file storage) | Strongly consistent except when performing list operations that get a list of buckets or objects. | There are no charges associated with making calls to Google Cloud Storage.
However, any data stored in Google Cloud Storage is charged the usual
Google Cloud Storage data storage fees. Cloud Storage prices are available on the Cloud Storage price sheet. |
These options are not mutually exclusive. For example, the same application can store information in a Cloud SQL database, and also store files in a Cloud Storage bucket.
See a complete list of the Google Cloud storage products on the Cloud Storage Products page.
Other cloud providers
App Engine apps can connect to external databases that are hosted on other public clouds as long as those database servers and your firewall are configured properly to accept connections. Your App Engine app connects over the Internet using that external service's public IP address.
Databases managed by a third-party vendor
There are many vendors offering managed database services such as mLab for MongoDB, Redis Labs offers hosted Redis caching. These vendors handle hosting, configuration, and maintenance of databases. App Engine can connect to these external services over the Internet, in the same way as other public clouds by using that service's public IP address.
On premises
If you have existing on-premises databases that you want to make accessible to your App Engine app, you can either configure your internal network and firewall to give the database a public IP address or connect using a VPN.
Production considerations
App Engine can be configured to automatically scale your application horizontally based on various metrics. Unlike web applications, databases often require non-trivial changes to respond to scale. In production applications, App Engine can quickly overwhelm a database during traffic spikes. You should take the anticipated average traffic load and load during spikes into consideration when configuring and deploying databases.