Firestore is GCP's document-oriented NoSQL database, widely adopted as the backend for Mobile and Web applications. Its hallmarks are tight Firebase integration, real-time sync, offline support, and declarative access control via Security Rules.
| Aspect | Native mode | Datastore mode |
|---|---|---|
| Released | 2017 | Datastore-compatible |
| Real-time sync | Yes | — |
| Mobile/Web SDK | Yes | — |
| Security Rules | Yes | — |
| Strong Consistency | Yes | Partial (within ancestor queries) |
| Recommended for new projects | Yes | — |
where('status', '==', 'active')where('age', '>=', 20) (one field only)where('tags', 'array-contains', 'js')where(Filter.or(a, b)) (since 2023)| Item | Price |
|---|---|
| Document reads | $0.06 / 100,000 |
| Document writes | $0.18 / 100,000 |
| Document deletes | $0.02 / 100,000 |
| Storage | $0.18 / GB / month |
| Network | Standard egress pricing |
| Monthly free tier | 50K reads / 20K writes / 20K deletes / 1 GB |
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /users/{userId} {
allow read: if request.auth != null;
allow write: if request.auth.uid == userId;
}
match /posts/{postId} {
allow read: if true;
allow create: if request.auth != null;
allow update, delete: if request.auth.uid == resource.data.authorId;
}
}
}// JavaScript SDK
import { onSnapshot, doc } from "firebase/firestore";
const unsub = onSnapshot(doc(db, "chats", "room1"), (docSnap) => {
console.log("Changes:", docSnap.data());
});
// Cleanup
unsub();| Aspect | Firestore | DynamoDB | Cosmos DB | MongoDB Atlas |
|---|---|---|---|---|
| Model | Document | KV + Document | Multi-model | Document |
| Real-time sync | Native | DynamoDB Streams | Change feed | Change Streams |
| Billing unit | Operation count | RCU/WCU | RU | VM hours |
| Free tier | Yes (always-free) | Yes (25 GB) | Yes (1000 RU) | $0/month Free Tier |
| Primary use | Mobile/Web | Serverless APIs | Multi-cloud | OSS-compatible |
How are Firestore and Datastore related?
Firestore is the evolution of Datastore. Firestore in Native mode is the true next-generation product, while Firestore in Datastore mode is Datastore-compatible. For new projects, Native mode is the only sensible choice.
Is Firestore only for Firebase?
No. Firestore can be used from a plain GCP project as well. Firebase is a BaaS bundle that integrates Firestore, Auth, Storage, and more, which makes it the easier path for Web/Mobile apps.
How does real-time sync work?
The Firestore SDK's onSnapshot listener streams document changes to clients in real time over WebSocket. It is the more capable successor to Firebase Realtime Database.
What are the query limitations?
A single query can only use a range comparison on one field, and many queries require a Composite Index. Inequality filters are limited to a single field as well.
How is Firestore priced?
You pay for document reads, writes, and deletes, plus storage and network egress. The free tier covers 50,000 reads / 20,000 writes / 20,000 deletes / 1 GB of storage per month.
When should I use Firestore vs Cloud Spanner?
Firestore is a document NoSQL store, ideal for real-time Mobile/Web apps. Spanner is a NewSQL relational database for enterprise workloads with complex transactions. They solve entirely different problems.
How are Security Rules written?
Firestore Security Rules let you declaratively define read/write conditions. They integrate with Firebase Auth, making per-user access control straightforward.
Does Firestore support Vector Search?
Yes, in preview since 2024. It is built on ScaNN and supports KNN queries, so it can power RAG and recommendation workloads.
Related Articles: NoSQL / Mobile
GCP vs AWS ストレージ・DB 徹底比較|GCS/S3・BigQuery/Redshift・Spanner/DynamoDB (2026)
GCP と AWS のストレージ・データベースを徹底比較。Cloud Storage vs S3、BigQuery vs Redshift、Spanner vs DynamoDB / Aurora DSQL、Cloud SQL vs RDS、AlloyDB vs Aurora、Firestore vs DynamoDB、Bigtable vs DynamoDB を 2026 年最新版で網羅。
Spanner vs DynamoDB vs Cosmos DB 徹底比較|グローバル NoSQL / NewSQL 選び方 (2026)
Google Spanner / AWS DynamoDB / Azure Cosmos DB / Aurora DSQL の徹底比較。アーキ、料金、整合性 (Strong / Eventual)、Multi-region 書き込み、サーバレス対応、用途別おすすめを 2026 年最新版で網羅。
GCP Professional Cloud Database Engineer (PCDBE) 完全ガイド|Spanner・AlloyDB・Cloud SQL
Google Cloud Professional Cloud Database Engineer の試験範囲、Spanner / AlloyDB / Cloud SQL / Bigtable / Firestore、AWS DBS・Azure DP-300 比較を詳解。
Spanner 完全ガイド|グローバル分散 NewSQL の全機能・料金・他 DB 比較
Google Cloud Spanner の全機能解説。TrueTime、External Consistency、水平スケール、料金 (Processing Unit)、Spanner Graph、PostgreSQL Interface、AWS Aurora DSQL / CockroachDB 比較を網羅。
* Google Cloud and Firebase are trademarks of Google LLC. For the latest information, see the official Firestore docs.
Practice with certification-focused question sets
View GCP exam prepNicheeLab Editorial Team
NicheeLab editorial team focused on data engineering and cloud certification learning. Content is structured around practical study needs and official exam domains.
Google Cloud Certification Roadmap (2026)
Choose your GCP certification path — Foundational, Associate...
CDL Cloud Digital Leader: Complete Exam Guide (2026)
Pass the Cloud Digital Leader exam — cloud business value, G...
GAIL Generative AI Leader: Complete Exam Guide (2026)
Pass the Generative AI Leader exam — Gemini, Vertex AI, Work...
Vertex AI Fundamentals for GCP Certs (2026)
Vertex AI basics every cert candidate needs — Workbench, Pip...
Associate Cloud Engineer (ACE): Complete Guide (2026)
Pass the Associate Cloud Engineer exam — Console, gcloud, pr...