App Engine 執行個體跟 Compute Engine 執行個體一樣,都是同一個私人內部網路的一部分。
您的 App Engine 應用程式可以跟同一專案內的 Compute Engine 託管的多項服務進行通訊,不用經由公開網際網路。在多數情況下,應用程式會使用執行個體的內部 IP 位址連線到服務,您不必將外部公開 IP 位址指派給資料庫。如有需要,您可以指派公開 IP 位址,以允許從 Google Cloud外部存取資料庫。
您可以利用 Google Cloud Marketplace,快速地將 Redis、MongoDB、PostgreSQL、Cassandra、Hadoop 和 Microsoft SQL Server 等眾多常見的第三方資料庫部署至 Compute Engine。如要進一步瞭解如何部署 MySQL 或 PostgreSQL,請參閱下列指南。
其他雲端服務供應商
App Engine 應用程式可以連線至其他公用雲端託管的外部資料庫,前提是這些資料庫伺服器和您的防火牆均已適當設定,可以接受連線。您的 App Engine 應用程式會利用外部服務的公開 IP 位址,透過網際網路建立連線。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-04 (世界標準時間)。"],[[["\u003cp\u003eApp Engine applications can utilize various storage solutions, including Google Cloud services, third-party databases, and on-premises databases.\u003c/p\u003e\n"],["\u003cp\u003eGoogle Cloud offers storage services like Firestore in Datastore mode, Cloud SQL for MySQL and PostgreSQL, and Cloud Storage, which are recommended for App Engine flexible environment apps.\u003c/p\u003e\n"],["\u003cp\u003eApp Engine can communicate with services hosted on Compute Engine within the same project using the instance's internal IP address, without needing a public IP.\u003c/p\u003e\n"],["\u003cp\u003eApp Engine apps can connect to external databases hosted on other public clouds or managed by third-party vendors via the Internet using the service's public IP address.\u003c/p\u003e\n"],["\u003cp\u003eApp Engine can use a VPN to access on-premises databases using the database server's internal IP address, without exposing the database server to the public internet.\u003c/p\u003e\n"]]],[],null,["# Understanding data and file storage\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nTo store data and files on App Engine, you can use Google Cloud services\nor any other storage service that is supported by your language and is\naccessible from your App Engine instance. Third-party databases\ncan be hosted on\n[Compute Engine](/compute), hosted on another cloud provider,\nhosted on premises, or managed by a third-party vendor.\n\nGoogle Cloud storage services\n-----------------------------\n\nFor App Engine apps running in the flexible environment, we recommend\none of the following Google Cloud storage services:\n\n- [Firestore in Datastore mode](/appengine/docs/flexible/using-firestore-in-datastore-mode) to store data in a NoSQL database. Note that Firestore in Datastore mode is available for all runtimes except the .NET runtime.\n- [Cloud SQL for MySQL](/sql/docs/mysql/connect-app-engine-flexible) to store data in a MySQL database.\n- [Cloud SQL for PostgreSQL](/sql/docs/postgres/connect-app-engine-flexible) to store data in a PostgreSQL database.\n- [Cloud Storage](/appengine/docs/flexible/using-cloud-storage) to read and write files in the runtime environment, as well as [store and serve static files](/appengine/docs/flexible/serving-static-files), such as movies or images or other static content.\n\nSee a complete list of the Google Cloud storage products on the\n[Cloud Storage Products page](/products/storage).\n\nHosting on Compute Engine\n-------------------------\n\nApp Engine instances are part of the same [private internal\nnetwork](/vpc/docs/vpc#app-engine-comm) as Compute Engine instances.\nYour App Engine app can communicate with services hosted on\nCompute Engine within the same project without going through the public\ninternet. In many cases, your app connects to the service using the\ninstance's internal IP address without needing to assign the database an\nexternal, public IP address. If desired, you can assign a public IP address to\nallow the database to be accessed from outside of Google Cloud.\n\nMany popular third-party databases such as Redis, MongoDB, PostgreSQL,\nCassandra, Hadoop, and Microsoft SQL Server can be quickly deployed to\nCompute Engine by using the\n[Google Cloud Marketplace](/marketplace). See the following guides for details about\ndeploying [MySQL](/solutions/setup-mysql) or\n[PostgreSQL](/solutions/setup-postgres).\n\n\nOther cloud providers\n---------------------\n\nApp Engine apps can connect to external databases that are hosted on\nother public clouds as long as those database servers and your firewall are\nconfigured properly to accept connections. Your App Engine app connects\nover the Internet using that external service's public IP address.\n\nDatabases managed by a third-party vendor\n-----------------------------------------\n\nThere are many vendors offering managed database services such as\n[mLab](/mongodb) for MongoDB, Redis Labs offers hosted\n[Redis caching](https://redislabs.com/redis-enterprise/cloud/). These vendors handle\nhosting, configuration, and maintenance of databases. App Engine can\nconnect to these external services over the Internet, in the same way as other\npublic clouds by using that service's public IP address.\n\nOn premises\n-----------\n\nIf you have existing on-premises databases that you want to make accessible to\nyour App Engine app, you can either configure your internal\nnetwork and firewall to give the database a public IP address or connect using a\nVPN.\n\nSetting up [Cloud VPN](/network-connectivity/docs/vpn) allows your App Engine\napp to access your on-premises network without directly exposing the\ndatabase server to the public internet. Because App Engine and\nCompute Engine use the same networking infrastructure, you can use the VPN\nconnection to establish a connection between the App Engine app\nand your on-premises database using the database server's internal IP address.\n\nProduction considerations\n-------------------------\n\nApp Engine can be configured to automatically scale your application\n[horizontally](https://wikipedia.org/wiki/Scalability#Horizontal_and_vertical_scaling)\nbased on various metrics. Unlike web applications, databases often\nrequire non-trivial changes to respond to scale. In production applications,\nApp Engine can quickly overwhelm a database during traffic spikes. You\nshould take the anticipated average traffic load and load during spikes into\nconsideration when configuring and deploying databases."]]