Cloud Firestore introduces new features such as:
- A new, strongly consistent storage layer
- A collection and document data model
- Real-time updates
- Mobile and Web client libraries
Although Cloud Firestore is backwards compatible with Cloud Datastore, the new data model, real-time updates, and mobile and web client library features are not. Cloud Firestore will give you the option to create a database instance in Datastore mode.
Cloud Firestore in Datastore mode
Cloud Firestore in Datastore mode uses Cloud Datastore system behavior but accesses Cloud Firestore's storage layer, removing the following Cloud Datastore limitations:
- Eventual consistency, all Cloud Datastore queries become strongly consistent.
- 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 Cloud Firestore features that are not compatible with Cloud Datastore:
- The project will accept Cloud Datastore API requests and deny Cloud Firestore API requests.
- The project will use Cloud Datastore indexes instead of Cloud Firestore indexes.
- You can use Cloud Datastore client libraries with this project but not Cloud Firestore client libraries.
- Cloud Firestore real-time capabilities will not be available.
- In the GCP console, the database will use the Cloud Datastore viewer.
Automatic upgrade to Cloud Firestore in Datastore mode
After Cloud Firestore is released as a GA product, we will gradually upgrade existing Cloud Datastore databases to Cloud Firestore in Datastore mode.
Choosing a database
When you create a new Cloud Datastore instance, you will have the option to create a Cloud Datastore database or a Cloud Firestore database. Additionally, a Cloud Firestore database can run in one of two modes, Native mode or Datastore mode. This gives you the following three options:
- Cloud Datastore
- Creates a Cloud Datastore database with existing features and limitations.
- Cloud Firestore in Datastore mode
- Gives your project access to Cloud Firestore's improved storage layer while keeping Cloud Datastore system behavior.
- Cloud Firestore in Native mode
- Gives you access to all Cloud Firestore features, including real-time updates and mobile and web client libraries.
Which database is right for your project?
If your app requires a service level agreement (SLA), choose Cloud Datastore.
Cloud Datastore is a mature product backed by an SLA. Cloud Firestore in Native mode and Cloud Firestore in Datastore mode are not backed by an SLA during beta.
If you are comfortable using a product in beta, use Cloud Firestore in Datastore mode for new server projects.
Cloud Firestore in Datastore mode allows you to use established Cloud Datastore server architectures while removing fundamental Cloud Datastore limitations.
If you are comfortable using a product in beta, use Cloud Firestore in Native mode for new mobile and web apps.
Cloud Firestore offers mobile and web client libraries with real-time and offline features.
The following table compares the system behavior of the three database options:
|Cloud Datastore||Cloud Firestore
|Data model||Entities organized into kinds and entity groups.||Entities organized into kinds and entity groups.||Document database organized into documents and collections.|
|Storage Layer||Storage layer is strongly consistent only in certain cases, eventually consistent elsewhere||New storage layer that is always strongly consistent||New storage layer that is always strongly consistent|
|Queries and transactions||
|Cloud Datastore v1 API support||Yes||Yes||No, requests are denied|
|Cloud Firestore v1beta1 API support||No, requests are denied||No, requests are denied||Yes|
|Real-time updates||Not supported||Not supported||
While listening to a document or set of documents, your clients are notified of any data changes and sent the newest set of data.
Note: Not available in Go, PHP, Python or Ruby server client libraries.
|Offline data persistence||Not supported||Not supported||The mobile and web client libraries support offline data persistence.|
Cloud Datastore Client libraries:
Cloud Datastore Client libraries:
Cloud Firestore client libraries:
|Security||Cloud Identity and Access Management (IAM) manages database access||Cloud Identity and Access Management (IAM) manages database access||
|Performance||Mature feature set that can scale to millions of writes||Not yet fully optimized; may experience increased latency during beta||Not yet fully optimized; may experience increased latency during beta|
|SLA||Cloud Datastore SLA||No SLA during the beta period. Preview the Cloud Firestore SLA.||No SLA during the beta period. Preview the Cloud Firestore SLA.|
|Pricing||Cloud Firestore (either mode) and Cloud Datastore have the same pricing structure|
|Console||GCP console Datastore Viewer||GCP console Datastore Viewer||Firebase Console|
|Namespaces||Namespaces supported||Namespaces supported||Not supported|
|App Engine client library integration||Supported in all runtimes||Supported in all runtimes|
Not supported in the App Engine standard environment Python 2.7 and PHP 5.5 runtimes
Supported in the App Engine standard environment Python 3.7, PHP 7.2, Java 8, Go, and Node.js runtimes
Supported in the App Engine flexible environment, all runtimes