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.For information about reading and writing temporary files, see Reading and Writing Temporary Files.
Google Cloud storage services
For App Engine apps running in the standard environment, we recommend one of the following Google Cloud storage services:
- Firestore in Datastore mode to store data in a NoSQL database.
- Cloud SQL for MySQL to store data in a MySQL database.
- Cloud SQL for PostgreSQL to store data in a PostgreSQL database.
- Cloud Storage to read and write files in the runtime environment, as well as store and serve static files, such as movies or images or other static content.
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.
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.
Setting up Cloud VPN allows your App Engine app to access your on-premises network without directly exposing the database server to the public internet. Because App Engine and Compute Engine use the same networking infrastructure, you can use the VPN connection to establish a connection between the App Engine app and your on-premises database using the database server's internal IP address.
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.