Python 2.7 はサポートが終了しており、2026 年 1 月 31 日に
非推奨になります。非推奨になると、過去に組織のポリシーを使用して以前のランタイムのデプロイを再度有効にしていた場合でも、Python 2.7 アプリケーションをデプロイできなくなります。既存の Python 2.7 アプリケーションは、
非推奨日以降も引き続き実行され、トラフィックを受信します。
サポートされている最新バージョンの Python に移行することをおすすめします。
データとファイルの保存について
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
App Engine にデータやファイルを保存するには、 Google Cloud サービスを使用できます。また、ご使用の言語でサポートされていて、App Engine インスタンスからアクセスできるストレージ サービスであれば、他のどのサービスでも使用できます。これらのサードパーティ データベースは、別のクラウド プロバイダでホストすることも、オンプレミスでホストすることも、サードパーティのベンダーが管理することも可能です。
Google Cloud ストレージ サービス
Python 2 スタンダード環境で実行される App Engine アプリには、次のいずれかの Google Cloud ストレージ サービスをおすすめします。
これらの方法は組み合わせて使用できます。たとえば、同じアプリケーションで Cloud SQL データベースに情報を保存し、Cloud Storage バケットにファイルを保存できます。
Google Cloud ストレージ サービスの完全なリストについては、Cloud Storage プロダクトのページをご覧ください。
他のクラウド プロバイダ
App Engine アプリは、外部のデータベース サーバーと内部のファイアウォールが接続を受け入れるように適切に構成されていれば、他のパブリック クラウドでホストされる外部データベースに接続できます。App Engine アプリがインターネット経由で接続する際は、その外部サービスのパブリック IP アドレスを使用します。
サードパーティ ベンダーが管理するデータベース
MongoDB 用の mLab、Redis Labs のホスト型 Redis キャッシュ機能など、多くのベンダーがマネージド データベース サービスを提供しています。これらのベンダーは、データベースのホスティング、構成、メンテナンスを受け持ちます。App Engine はそれらの外部サービスにインターネット経由で接続できますが、その際は他のパブリック クラウドがそれらのサービスにパブリック IP アドレスを使用して接続するのと同じ方法を使用します。
オンプレミス
既存のオンプレミス データベースを App Engine アプリからアクセスできるようにするには、内部ネットワークとファイアウォールを構成してデータベースにパブリック IP アドレスを提供するか、または VPN を使用して接続します。
本番環境に関する考慮事項
App Engine は、さまざまな指標に基づいて、自動的にアプリケーションを水平スケールするよう構成できます。ウェブ アプリケーションとは異なり、データベースはスケールに対応するために、大規模な変更を必要とすることがよくあります。本番環境のアプリケーションでは、トラフィックが急増すると、App Engine からのデータ量がデータベースの容量を急激に上回る場合があります。データベースを構成してデプロイする際は、予想される平均トラフィックの負荷とトラフィック急増時の負荷を考慮に入れる必要があります。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-09-04 UTC。
[[["わかりやすい","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 UTC。"],[[["\u003cp\u003eApp Engine allows data storage through Google Cloud services, external cloud providers, third-party vendors, or on-premises databases.\u003c/p\u003e\n"],["\u003cp\u003eGoogle Cloud offers several storage options including Firestore in Datastore mode (NoSQL), Cloud SQL (relational), and Cloud Storage (file storage), each with unique consistency models and pricing structures.\u003c/p\u003e\n"],["\u003cp\u003eApp Engine apps can connect to external databases hosted on other cloud platforms or managed by third-party vendors, provided the servers and firewalls are configured to allow connections via public IP addresses.\u003c/p\u003e\n"],["\u003cp\u003eFor on-premises databases, connectivity to App Engine can be established by configuring a public IP address for the database or using a VPN.\u003c/p\u003e\n"],["\u003cp\u003eDatabase scalability should be carefully considered in production, as App Engine's ability to scale horizontally can lead to traffic spikes that overwhelm databases if they are not configured appropriately.\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 Python 2 standard environment, we recommend\none of the following Google Cloud storage services:\n\n\nThese options are not mutually exclusive. For example, the same application\ncan store information in a Cloud SQL database, and also store files in a Cloud\nStorage bucket.\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.\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."]]