Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Firestore in "Datastore mode" have any advantages "Native mode"

Google Cloud Firestore is going to replace the legacy Google Cloud Datastore soon. One then has the choice between using Cloud Firestore in "native mode" or in "datastore mode". The former allows access to Firestore through the usual Firestore SDK while the latter allows usage of the old Cloud Datastore SDK (which has no Web/Mobile APIs).

I am not yet familiar with Firestore. My question is: Apart from porting things to a new API, are there actually any things that can not be done with Firestore in "native mode" which could be done with the old Cloud Datastore (or its replacement: Firestore in "datastore mode")? Or any other advantage of using "datastore mode" (like costs, for example)?

If not, then it seems there is actually no advantage of using Firestore in "datastore mode" other than compatibility for older code using the old Cloud Datastore.

Am I right in my assumption that Firestore "datastore mode" has absolutely no advantage besides being able to use the legacy Datastore API (at the cost of not being able to use the newer and probably more feature-rich Firestore APIs, including mobile and web APIs)?

like image 873
trollkotze Avatar asked Aug 12 '18 04:08

trollkotze


People also ask

What is the difference between native mode and Datastore mode?

Datastore mode can automatically scale to millions of writes per second. Use Firestore in Native mode for new mobile and web apps. Firestore offers mobile and web client libraries with real-time and offline features. Native mode can automatically scale to millions of concurrent clients.

What is firestore in Datastore mode?

Firestore in Datastore mode is a NoSQL document database built for automatic scaling, high performance, and ease of application development. Firestore is the newest version of Datastore and introduces several improvements over Datastore.

When should I use Datastore?

DataStore is ideal for small, simple datasets and does not support partial updates or referential integrity.

Is Datastore deprecated?

upload_files" is deprecated after version 1.0. 69 #1672.


1 Answers

Cost.

Firestore in Datastore mode supports key-only and projection queries just like the original datastore. That means that the result set of those queries counts towards "Cloud Firestore Small Operations" which are free. We accumulate billions of those small operations per day and not having projection queries would effectively 10-fold our datastore cost which would be unbearable.

As this feature is not available in Firestore native mode - and also with the strong consistency added in - we expected it to be less performant then in the original datastore, but in our tests this was not the case. Firestore in datastore mode consistently performed about twice as fast for our application across all types of operations.

like image 62
as5wolf Avatar answered Sep 29 '22 19:09

as5wolf