Cloud Run functions と Firebase
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Google Cloud Run functions と Cloud Functions for Firebase は、イベント ドリブンのアプリケーションを作成するための Google のサーバーレス コンピューティング ソリューションの重要な部分を構成しています。
Google Cloud Platform のデベロッパー: Cloud Run functions はイベントをリッスンしてレスポンスする接続層として機能します。これにより、Google Cloud Platform(GCP)サービス間でロジックを構築できるようになります。
Firebase のデベロッパー: Cloud Functions for Firebase はサーバーサイド コードを追加することによって、Firebase の動作を拡張し、Firebase の機能を統合します。
どちらのソリューションでも、サーバーの管理やインフラストラクチャのプロビジョニングについて心配する必要のない完全に管理された環境で、ファンクションを迅速かつ確実に実行できます。
Cloud Functions for Firebase
モバイルアプリまたはモバイル ウェブアプリを構築するデベロッパーは、Cloud Functions for Firebase を使ったほうが便利です。モバイル デベロッパーは、Firebase を使用して、アナリティクス、認証、Realtime Database といった、モバイル中心のフルマネージド サービスすべてにアクセスできます。Cloud Functions は、サーバー側コードの追加により Firebase 機能の動作を拡張させて接続する方法を提供することで、サービスを向上させます。
Firebase デベロッパーは、支払いの処理や SMS メッセージの送信などのタスクについて、外部サービスと簡単に統合できます。また、処理が重すぎてモバイル デバイスには含められないカスタム ロジックや、サーバー上に置いてセキュリティを確保する必要があるカスタム ロジックでも含めることができます。
ユースケースを確認すると、一般的な統合について学習できます。
フル機能のバックエンドを必要とする場合は、Google Cloud Platform の強力な機能へのゲートウェイとして Cloud Run functions を利用できます。
Cloud Functions for Firebase は、Firebase デベロッパー向けに最適化されています。
- コードによってファンクションを構成する Firebase SDK
- Firebase コンソールおよび Firebase CLI との統合
- Google Cloud Functions と同じトリガーに加えて、Firebase Realtime Database、Firebase Authentication、Firebase 向け Google アナリティクスの各トリガー
デベロッパーは、関数の形式でコードを記述することで、GCP サービスを接続させて拡張できます。Cloud Run functions は接続層として機能し、イベントをリッスンして応答することで、GCP サービス間でロジックを組み立てることができます。数行のコードを使用するだけで、デベロッパーがサーバーのプロビジョニングや管理を行うことなく、GCP サービスをより便利に、高度に組み合わせて使用できるようになります。
詳細については、Google Cloud Run functions のドキュメントをご覧ください。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-08-17 UTC。
[null,null,["最終更新日 2025-08-17 UTC。"],[],[],null,["\u003cbr /\u003e\n\nGoogle Cloud Run functions and Cloud Functions for Firebase together\ncomprise an important part of Google's serverless compute solution for creating\nevent-driven applications.\n\nFor **Google Cloud Platform developers** , [Cloud Run\nfunctions](https://cloud.google.com/functions/) serve as a connective layer\nallowing you to weave logic between Google Cloud Platform (GCP) services by\nlistening for and responding to events.\n\nFor **Firebase developers** ,\n[Cloud Functions for Firebase](https://firebase.google.com/docs/functions/)\nprovides a way to extend the behavior of Firebase and integrate Firebase\nfeatures through the addition of server-side code.\n\nBoth solutions provide fast and reliable execution of functions in a fully\nmanaged environment where there's no need for you to worry about managing any\nservers or provisioning any infrastructure.\n\nCloud Functions for Firebase\n\nYou should use Cloud Functions for Firebase if you're a developer building a\nmobile app or mobile web app. Firebase gives mobile developers access to a\ncomplete range of fully managed mobile-centric services including analytics,\nauthentication and Realtime Database. Cloud Functions rounds out the offering\nby providing a way to extend and connect the behavior of Firebase features\nthrough the addition of server-side code.\n\nFirebase developers can easily integrate with external services for tasks like\nprocessing payments and sending SMS messages. Also, developers can include\ncustom logic that is either too heavyweight for a mobile device, or\nwhich needs to be secured on a server.\n[Explore use cases](https://firebase.google.com/docs/functions/use-cases)\nto learn more about typical integrations.\nFor developers that need a more full-featured backend, Cloud Run\nfunctions provides a gateway to the powerful capabilities in\n[Google Cloud Platform](https://cloud.google.com/docs/).\n\nCloud Functions for Firebase is optimized for Firebase developers:\n\n- Firebase SDK to configure your functions through code\n- Integrated with Firebase Console and Firebase CLI\n- The same triggers as Google Cloud Functions, plus Firebase Realtime Database, Firebase Authentication, and Firebase Analytics triggers\n\nCloud Run functions for Google Cloud Platform\n\nDevelopers can connect and extend GCP services by writing code in the form of a\nfunction. Cloud Run functions serve as a connective layer allowing you to\nweave logic between GCP services by listening for and responding to events. With\njust a few lines of code, developers can enrich their use of GCP services to\ncreate higher level combinations without needing to provision or manage servers.\nSee the [Google Cloud Run functions\ndocumentation](https://cloud.google.com/functions/docs/) for more information."]]