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 Storage & DB Comparison (2026)
Cloud Storage vs. S3, BigQuery vs. Redshift, Spanner vs. Aurora. Honest feature-by-feature comparison.
Spanner vs DynamoDB vs Cosmos DB (2026)
Three globally-distributed databases compared — consistency, scaling, cost. Decision framework.
Professional Cloud Database Engineer (PCDBE): Guide (2026)
Pass the PCDBE exam — Cloud SQL, Spanner, AlloyDB, Bigtable, migration. The database Professional cert.
Cloud Spanner Complete Guide (2026)
Spanner architecture — split, leader, regional vs. multi-region. The globally-distributed SQL DB.
* 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...