Skip to content

Firestore (Document DB)

Firestore is a flexible, scalable database for mobile, web, and server development from Firebase and Google Cloud. Firestore keeps your data in sync across client apps through realtime listeners and offers offline support for mobile and web so you can build responsive apps that work regardless of network latency or Internet connectivity. Firestore also offers seamless integration with other Firebase and Google Cloud products, including Cloud Run functions.

image.png


Key capabilities
Column 1
Column 2
Flexibility
The 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.
Expressive querying
In 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 dataset.
Designed to scale
Firestore brings you automatic multi-region data replication, strongly-consistent queries, atomic batch operations, and transaction support.
Realtime updates
Firestore uses data synchronization to update data on any connected device. However, it's also designed to make simple, one-time fetch queries efficiently.
Offline support
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, Firestore synchronizes any local changes back to Firestore.
There are no rows in this table

Choosing between Native mode and Datastore mode

When you create a new Firestore database, you can configure the database instance to run in Datastore mode which makes the database backwards-compatible with Datastore.

Firestore in Native mode

Firestore is the next major version of Datastore and a re-branding of the product. Taking the best of Datastore and the , Firestore is a NoSQL document database built for automatic scaling, high performance, and ease of application development.
Firestore introduces the following features:
A strongly consistent storage layer
A collection and document data model
Real-time updates
Mobile and Web client libraries
Firestore is backwards compatible with Datastore, but the new data model, real-time updates, and mobile and web client library features are not. To access all Firestore features, you must use Firestore in Native mode.

Firestore in Datastore mode

Firestore in Datastore mode uses Datastore system behavior but accesses Firestore's storage layer, removing the following Datastore limitations:
All Datastore queries are now strongly consistent, unless you explicitly request .
Queries in transactions are no longer required to be ancestor queries.
Transactions are no longer limited to 25 entity groups.
Writes to an entity group are no longer limited to 1 per second.
Datastore mode disables Firestore features that are not compatible with Datastore:
The project will accept Datastore API requests and deny Firestore API requests.
The project will use Datastore indexes instead of Firestore indexes.
You can use Datastore client libraries with this project but not Firestore client libraries.
Firestore real-time capabilities will not be available.
In the Google Cloud console, the database will use the Datastore viewer.



image.png


Want to print your doc?
This is not the way.
Try clicking the ··· in the right corner or using a keyboard shortcut (
CtrlP
) instead.