From Google App Engine, you can easily access other Google Cloud Platform services such as Cloud Datastore, Cloud SQL, and Cloud Storage. However, you can also choose from a variety of third-party databases to use with your applications such as Redis, MongoDB, PostgreSQL, Cassandra, and Hadoop.
You can use any third-party database supported by your language if the database is accessible from the Google App Engine instance. These third-party databases can be hosted on Compute Engine, hosted on another cloud provider, hosted on premises, or managed by a third-party vendor.
Hosting on Compute Engine
Many popular third-party databases such as Redis, MongoDB, PostgreSQL, Cassandra, and Hadoop, can be quickly deployed to Compute Engine using the Cloud Launcher. There are also detailed guides on deploying MySQL and PostgreSQL.
App Engine flexible environment instances are part of the same private internal network as Compute Engine instances. Your App Engine flexible environment application can communicate with services hosted on Compute Engine within the same project without going through the public internet. In many cases, your application connects to the service using the instance's internal IP address without needing to assign the database an external, public IP address. If desired, you can assign a public IP address to allow the database to be accessed from outside of Google Cloud Platform.
Other cloud providers
App Engine applications can connect to databases hosted on other public clouds if the database server and firewall are configured properly to accept connections. Your App Engine application connects to the database using the 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. These vendors handle hosting, configuration, and maintenance of databases. App Engine can connect to these services in the same way as other public clouds, via the service's public IP address.
If you have existing on-premises databases that you want to make accessible to your App Engine application, you can configure your internal network and firewall to give the database a public IP address.
You can also connect using a VPN if you use App Engine flexible environment. Setting up Cloud VPN allows your App Engine application 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 application 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.