Go 1.11 已終止支援,並將於 2026 年 1 月 31 日
淘汰。淘汰後,您將無法部署 Go 1.11 應用程式,即使貴機構先前使用機構政策重新啟用舊版執行階段的部署作業也一樣。現有的 Go 1.11 應用程式在
淘汰日期過後,仍會繼續執行並接收流量。建議您
遷移至最新支援的 Go 版本。
瞭解資料與檔案儲存空間
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
如要在 App Engine 上儲存資料與檔案,可以使用 Google Cloud 服務或您的語言支援且可從 App Engine 執行個體存取的其他任何儲存空間服務。這些第三方資料庫可能由其他雲端服務供應商託管、在內部部署環境中託管,或由第三方廠商代管。
Google Cloud 儲存空間服務
對於在 App Engine 中執行的 App Engine 應用程式,建議使用下列其中一項 Google Cloud 儲存空間服務:
如需 Google Cloud 儲存空間產品的完整清單,請參閱 Cloud Storage 產品頁面。
其他雲端服務供應商
App Engine 應用程式可以連線至其他公用雲端託管的外部資料庫,前提是這些資料庫伺服器和您的防火牆均已適當設定,可以接受連線。您的 App Engine 應用程式會利用外部服務的公開 IP 位址,透過網際網路建立連線。
第三方供應商代管的資料庫
許多服務供應商都提供代管資料庫服務,例如 MongoDB 的 mLab,以及 Redis Labs 提供的託管 Redis 快取服務。這些供應商可處理資料庫的託管、設定和維護作業。App Engine 可以透過網際網路連線至這些外部服務,方法跟其他公用雲端一樣,都是使用服務的公開 IP 位址進行連線。
內部部署
如要讓 App Engine 應用程式能夠存取現有的內部部署資料庫,您可以設定內部網路和防火牆來給予資料庫一個公開 IP 位址,或是使用 VPN 來連線。
設定
Cloud VPN 後,App Engine 應用程式就能存取內部部署網路,不必讓資料庫伺服器冒著直接暴露到公開網際網路的風險。App Engine 和 Compute Engine 都使用相同的網路基礎架構,因此您可以使用 VPN 連線,利用資料庫伺服器的內部 IP 位址來建立 App Engine 應用程式與內部部署資料庫之間的連線。
實際運作環境注意事項
您可以透過設定,讓 App Engine 依據各種指標,水平自動調整應用程式的資源配置。資料庫經常會因為資源調度而進行重大變更,這點與網路應用程式不同。在實際運作環境中出現龐大流量時,App Engine 可能會迅速導致資料庫癱瘓。建議您在設定和部署資料庫時,將預期的平均流量負載和尖峰時段負載納入考量。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-09-04 (世界標準時間)。
[[["容易理解","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 allows you to store data and files using various Google Cloud storage services, such as Firestore in Datastore mode, Cloud SQL for MySQL or PostgreSQL, and Cloud Storage for files.\u003c/p\u003e\n"],["\u003cp\u003eYou can connect App Engine apps to external databases hosted on other public clouds, provided the database servers and firewalls are configured to accept connections via public IP addresses.\u003c/p\u003e\n"],["\u003cp\u003eApp Engine can integrate with third-party managed database services, like mLab for MongoDB or Redis Labs for Redis caching, connecting via the service's public IP address.\u003c/p\u003e\n"],["\u003cp\u003eOn-premises databases can be accessed by App Engine apps by configuring the internal network to provide the database with a public IP address, or through a VPN connection using Cloud VPN for enhanced security.\u003c/p\u003e\n"],["\u003cp\u003eWhen deploying databases for production with App Engine, it is crucial to account for average traffic load and potential spikes, as databases may require significant adjustments to scale effectively.\u003c/p\u003e\n"]]],[],null,["# Understanding Data and File Storage\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 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 App Engine, we recommend\none of the following Google Cloud storage services:\n\n\n- [Firestore in Datastore mode](/appengine/docs/legacy/standard/go111/using-cloud-datastore) to store data in a NoSQL database\n\n\u003c!-- --\u003e\n\n- [Cloud SQL for MySQL](/sql/docs/mysql/connect-app-engine)\n to store data in a MySQL database\n\n- [Cloud SQL for PostgreSQL](/sql/docs/postgres/connect-app-engine)\n to store data in a PostgreSQL database\n\n- [Cloud Storage](/appengine/docs/legacy/standard/go111/using-cloud-storage)\n to read and write files in the runtime environment, as well as\n [store and serve static files](/appengine/docs/legacy/standard/go111/serving-static-files),\n such as movies or images or other static content\n\n\u003cbr /\u003e\n\nSee a complete list of the Google Cloud storage products on the\n[Cloud Storage Products page](/products/storage).\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.\nSetting up [Cloud VPN](/network-connectivity/docs/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.\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."]]