Firestore
Serverless, autoscaling document (NoSQL) database with real-time listeners and offline sync for web/mobile. Strong consistency, scales to zero cost when idle. Pick it for hierarchical mobile/web data - user profiles, game state. (Datastore mode is the legacy/server API.)
What Firestore gives you
A fast, fully managed, serverless, cloud-native NoSQL document database that simplifies storing, syncing, and querying data for mobile, web, and IoT apps at global scale.
- Live sync + offline support - client libraries keep data current and work offline
- Security + integrations - Firebase and Google Cloud integrations for truly serverless apps
- ACID transactions - all-or-nothing writes
- Automatic multi-region replication + strong consistency - data stays safe and available through outages
- Powerful query engine - sophisticated queries with no performance degradation, so you have more freedom in how you structure data
If any operation in a transaction fails and cannot be retried, the entire transaction fails - nothing is partially committed.
Native mode vs Datastore mode
Firestore is the next generation of Datastore. A single Firestore database runs in one of two modes, chosen at creation and not changeable later.
Creating a database in Datastore mode gives you Firestore's improved storage layer while keeping Datastore system behavior, which removes three old Datastore limits.
- Queries are strongly consistent, no longer eventually consistent
- Transactions are no longer limited to 25 entity groups
- Writes to an entity group are no longer limited to 1 per second
Firestore is backwards-compatible with Datastore, but the new data model, real-time updates, and mobile/web client libraries are not. To access all the new Firestore features you must use Native mode. As the next generation of Datastore, Firestore is compatible with all Datastore APIs and client libraries.
Choosing Firestore
Reach for Firestore when your schema might change and you need an adaptable database, you need to scale to zero, or you want low-maintenance scaling up to terabytes. If you do not require transactional consistency, consider Bigtable instead, depending on cost or size.