MongoDB 互換の Firestore Enterprise エディションが利用可能になりました。
詳細
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Cloud Firestore
plat_ios
plat_android
plat_web
plat_flutter
plat_cpp
plat_unity
plat_node
plat_java
plat_python
plat_go
Google Cloud インフラストラクチャ上に構築された柔軟でスケーラブルな NoSQL クラウド データベースを使用して、クライアントサイドおよびサーバーサイド開発用のデータを保存および同期します。
Cloud Firestoreは、Firebase と Google Cloud からのモバイル、ウェブ、サーバー開発に対応した、柔軟でスケーラブルなデータベースです。Firebase Realtime Database と同様に、リアルタイム リスナーを介してクライアント アプリ間でデータを同期し、モバイルとウェブのオフライン サポートを提供します。これにより、ネットワーク レイテンシやインターネット接続に関係なく機能するレスポンシブ アプリを構築できます。Cloud Firestore は、他の Firebase プロダクトや Google Cloud プロダクト(Cloud Functions など)とのシームレスなインテグレーションも実現します。
始めましょう
主な機能
柔軟性 |
Cloud Firestore データモデルは、柔軟な階層型データ構造に対応しています。データはドキュメントに格納され、ドキュメントはコレクションにまとめられます。ドキュメントには、サブコレクションの他に複雑なネスト オブジェクトを含めることができます。
|
高機能なクエリ処理 |
Cloud Firestore では、個別のドキュメントを取得する場合や、クエリ パラメータに一致するすべてのドキュメントをコレクションで取得する場合に、クエリを使用できます。クエリには複数の連鎖フィルタを使用でき、またフィルタ処理と並べ替え処理を組み合わせることができます。デフォルトではクエリにはインデックスが付いているので、クエリのパフォーマンスは、データセットではなく結果セットのサイズに比例します。
|
リアルタイム アップデート |
Realtime Database と同様に、Cloud Firestore はデータ同期を使用してコネクテッド デバイスのデータを更新します。ただし、シンプルな 1 回限りの取得クエリを効率的に実行するようにも設計されています。
|
オフライン サポート |
Cloud Firestore によってアプリが頻繁に使用するデータがキャッシュに保存されるため、デバイスがオフラインの場合でも、アプリはデータの書き込み、読み取り、リッスン、クエリを実行できます。デバイスがオンラインに戻ると、ローカルで行われた変更が Cloud Firestore によって Cloud Firestore に同期されます。 |
スケーラビリティのある設計 |
Cloud Firestore は、Google Cloud の強力なインフラストラクチャの優れた機能(自動マルチリージョン データ複製、強整合性の保証、アトミックなバッチ オペレーション、実際のトランザクションのサポート)を活用します。Cloud Firestore は、世界でも最大規模のアプリの最も過酷なワークロードに対応できるように設計されています。 |
仕組み

Cloud Firestore は、クラウドホストの NoSQL データベースであり、Apple アプリ、Android アプリ、およびウェブアプリからネイティブ SDK を介して直接アクセスできます。Cloud Firestore は、REST API と RPC API の他に、ネイティブ Node.js、Java、Python、Unity、C++、および Go SDK で使用可能です。
Cloud Firestore の NoSQL データモデルに従い、値に対応するフィールドを含むドキュメントにデータを格納します。これらのドキュメントはコレクションに格納されます。コレクションは、データの編成とクエリの作成に使用できるドキュメントのコンテナです。ドキュメントでは、単純な文字列や数値から複雑なネスト オブジェクトまで、さまざまなデータタイプがサポートされています。また、ドキュメント内にサブコレクションを作成し、データベースの拡大に合わせて拡張できる階層型データ構造を構築できます。Cloud Firestore データモデルでは、アプリに最適なあらゆるデータ構造がサポートされています。
また、Cloud Firestore でのクエリ処理は機能性、効率性、柔軟性に優れています。層が少ないクエリを作成することで、コレクション全体またはネスト サブコレクションを取得することなくドキュメント レベルでデータを取得できます。クエリまたはカーソルに並べ替え、フィルタ、制限を追加して、結果をページ処理できます。更新が発生するたびにデータベース全体を取得することなく、アプリ内のデータを最新の状態に保つには、リアルタイム リスナーを追加します。リアルタイム リスナーをアプリに追加すると、クライアント アプリがリッスンしているデータが変更されるたびに、アプリからデータ スナップショットにより通知され、新しい変更だけが取得されます。
Android、Apple プラットフォーム、JavaScript では Firebase Authentication と Cloud Firestore Security Rules を使用し、サーバーサイド言語では Identity and Access Management(IAM)を使用して Cloud Firestore のデータへのアクセスを保護します。
実装パス
|
Cloud Firestore SDK を統合する |
Gradle、CocoaPods、またはスクリプト インクルード経由でクライアントをすばやく統合します。 |
|
データをセキュリティで保護する |
Cloud Firestore Security Rules または Identity and Access Management(IAM)を使用して、モバイル / ウェブ開発とサーバー開発のデータをそれぞれ保護します。 |
|
データの追加 |
データベースにドキュメントとコレクションを作成します。 |
|
データを取得する |
クエリを作成するか、リアルタイム リスナーを使用して、データベースからデータを取得します。 |
次のステップ
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-08-17 UTC。
[null,null,["最終更新日 2025-08-17 UTC。"],[],[],null,["Cloud Firestore \nplat_ios plat_android plat_web plat_flutter plat_cpp plat_unity plat_node plat_java plat_python plat_go \nUse our flexible, scalable NoSQL cloud database, built\non Google Cloud infrastructure, to store and sync data for client- and\nserver-side development. \n\nCloud Firestore is a flexible, scalable database for mobile, web,\nand server development from Firebase and Google Cloud. Like\nFirebase Realtime Database, it keeps your data in sync across client apps through\nrealtime listeners and offers offline support for mobile and web so you can\nbuild responsive apps that work regardless of network latency or Internet\nconnectivity. Cloud Firestore also offers seamless integration with other Firebase\nand Google Cloud products, including Cloud Functions.\n\n[Get started](/docs/firestore/quickstart)\n\nKey capabilities\n\n|---------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Flexibility | The Cloud Firestore data model supports flexible, hierarchical data structures. Store your data in documents, organized into collections. Documents can contain complex nested objects in addition to subcollections. |\n| Expressive querying | In Cloud Firestore, you can use queries to retrieve individual, specific documents or to retrieve all the documents in a collection that match your query parameters. Your queries can include multiple, chained filters and combine filtering and sorting. They're also indexed by default, so query performance is proportional to the size of your result set, not your data set. |\n| Realtime updates | Like Realtime Database, Cloud Firestore uses data synchronization to update data on any connected device. However, it's also designed to make simple, one-time fetch queries efficiently. |\n| Offline support | Cloud Firestore caches data that your app is actively using, so the app can write, read, listen to, and query data even if the device is offline. When the device comes back online, Cloud Firestore synchronizes any local changes back to Cloud Firestore. |\n| Designed to scale | Cloud Firestore brings you the best of Google Cloud's powerful infrastructure: automatic multi-region data replication, strong consistency guarantees, atomic batch operations, and real transaction support. We've designed Cloud Firestore to handle the toughest database workloads from the world's biggest apps. |\n\nHow does it work?\n\nCloud Firestore is a cloud-hosted, NoSQL database that your Apple, Android, and web\napps can access directly via native SDKs. Cloud Firestore is also available\nin native Node.js, Java, Python, Unity, C++ and Go SDKs, in addition to REST and\nRPC APIs.\n\nFollowing Cloud Firestore's NoSQL data model, you store data in documents that\ncontain fields mapping to values. These documents are stored in\ncollections, which are containers for your documents that you can use to\norganize your data and build queries. Documents support many different\n[data types](/docs/firestore/manage-data/data-types), from simple strings and numbers, to\ncomplex, nested objects. You can also create subcollections within\ndocuments and build hierarchical data structures that scale as your\ndatabase grows. The Cloud Firestore [data model](/docs/firestore/data-model) supports whatever\ndata structure works best for your app.\n\nAdditionally, querying in Cloud Firestore is expressive, efficient, and flexible.\nCreate shallow queries to retrieve data at the document level without needing to\nretrieve the entire collection, or any nested subcollections. Add sorting,\nfiltering, and limits to your queries or cursors to\npaginate your results. To keep data in your apps current, without retrieving\nyour entire database each time an update happens, add realtime listeners.\nAdding realtime listeners to your app notifies you with a data snapshot whenever\nthe data your client apps are listening to changes, retrieving only the new\nchanges.\n\nProtect access to your data in Cloud Firestore with Firebase Authentication and\nCloud Firestore Security Rules for Android, Apple platforms, and JavaScript, or Identity\nand Access Management (IAM) for server-side languages.\n\nImplementation path\n\n|---|------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|\n| | Integrate the Cloud Firestore SDKs | Quickly include clients via Gradle, CocoaPods, or a script include. |\n| | Secure your data | Use Cloud Firestore Security Rules or Identity and Access Management (IAM) to secure your data for mobile/web and server development, respectively. |\n| | Add Data | Create documents and collections in your database. |\n| | Get Data | Create queries or use realtime listeners to retrieve data from the database. |\n\nNext steps\n\n- [Get started](/docs/firestore/quickstart) with Cloud Firestore --- set up your database, then add data and start reading it.\n- Learn more about the Cloud Firestore [data model](/docs/firestore/data-model).\n- Explore the [differences between Realtime Database and Cloud Firestore](/docs/firestore/rtdb-vs-firestore)."]]