Choosing between Cloud Firestore and Cloud Datastore

Cloud Firestore is the next major version of Cloud Datastore and a re-branding of the product. Taking the best of Cloud Datastore and the Firebase Realtime Database, Cloud Firestore is a NoSQL document database built for automatic scaling, high performance, and ease of application development. This page compares Cloud Firestore to Cloud Datastore and gives guidance on choosing between them.

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.

Feature comparison

The following table compares the system behavior of the three database options:

Cloud Datastore Cloud Firestore
Datastore Mode
Cloud Firestore
Native Mode
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 is strongly consistent only within entity groups and eventually consistent across entity groups
  • Eventually consistent queries sometimes return stale results.
  • Transactions limited to 25 entity groups.
  • Removes the consistency limitations of Cloud Datastore
  • Strongly consistent queries across the entire database
  • Transactions can access any number of entity groups
  • Strongly consistent queries across the entire database
  • Up to 500 documents per transaction across any number of collections.
  • Limitation: No collection group queries and projection queries.
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

Supports the ability to listen to a document or a set of documents for real-time updates.

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.
Client libraries Cloud Datastore Client libraries:
  • Java
  • Python
  • PHP
  • Go
  • Ruby
  • C#
  • Node.js
Cloud Datastore Client libraries:
  • Java
  • Python
  • PHP
  • Go
  • Ruby
  • C#
  • Node.js
Cloud Firestore client libraries:
  • Java
  • Python
  • PHP
  • Go
  • Ruby
  • C#
  • Node.js
  • Android
  • iOS
  • Web
Security Cloud Identity and Access Management (IAM) manages database access Cloud Identity and Access Management (IAM) manages database access
  • Cloud Identity and Access Management (IAM) manages database access
  • Cloud Firestore Security Rules support serverless authentication and authorization for the mobile and web client libraries
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.
Locations
  • US (Multi-region)
  • EU (Multi-region)
  • Montréal
  • Los Angeles
  • South Carolina
  • Northern Virginia
  • São Paulo
  • London
  • Frankfurt
  • Tokyo
  • Mumbai
  • Sydney
  • US (Multi-region)
  • South Carolina
  • Frankfurt
  • US (Multi-region)
  • South Carolina
  • Frankfurt
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

Was this page helpful? Let us know how we did:

Send feedback about...

Cloud Firestore