Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Support for Firestore in Native Mode #129

Open
stackswell opened this issue Sep 21, 2018 · 10 comments
Open

Feature Request: Support for Firestore in Native Mode #129

stackswell opened this issue Sep 21, 2018 · 10 comments

Comments

@stackswell
Copy link

This would be great, as Datastore is ultimately being deprecated and transitioned to Firestore. I would assume Gstore will still work with Firestore in Datastore mode, but as far as I can tell there is no sound ORM solution for Firestore in native mode.

@micaww
Copy link
Contributor

micaww commented Sep 22, 2018

Doesn't Firestore Native use a completely different protocol than Datastore?

Also yeah gstore-node should work with Firestore in Datastore mode because the API is fully backwards-compatible with the GDS API.

@sebelga
Copy link
Owner

sebelga commented Sep 22, 2018

Hi,
Some time ago, when I looked at the API of Firestore I thought: "gstore could totally have an adapter and support both the Datastore and Firestore, it'd be nice!". But then I thought about the real use case. If I am not wrong, as stated on the website, "Cloud Firestore is Firebase's new flagship database for mobile app development". So its main feature is to directly access the DB from within the client (Android/iOS/webapp) and bypass any server.
As gstore-node is a library for Node.js, I don't really see what it can bring in this scenario as it requires a server to sit in between the client and the db.

Am I wrong?

@sebelga
Copy link
Owner

sebelga commented Sep 26, 2018

Can you confirm that this repo is the "native" mode of firestore? https://github.com/googleapis/nodejs-firestore ? It seems that it might be possible to add an adapter. But then I am still not seeing the use case for Webapps (real time update would be lost). Could you elaborate your use case? 👍

@william-lpa
Copy link

Hi @sebelga , have you thought about this anymore? We're starting a new project and really want to use gstore-node. Since this a new project we wanted to jump directly to FireStore native rather than using Firestore in Datastore mode. We're not planning on using the Mobile API's however according to this (https://cloud.google.com/datastore/docs/firestore-or-datastore#choosing_a_database) we cannot switch from Datastore mode to Native mode without starting a new project.

@sebelga
Copy link
Owner

sebelga commented Nov 30, 2018

Hi @william-lpa I didn't look more into it as I didn't get an answer to my previous comments 😊 Could you confirm if what I was mentioning is correct? It seems to me that Firestore web client goes directly from the browser to the DB (no Node.js server). It then probably opens a Websocket connection for live updates (?)

@delamart
Copy link

delamart commented Nov 30, 2018

Hi @sebelga you are correct that Firebase products were originally to be used directly by the client. However with cloud functions you can now use the classical frontend-backend split with a nodejs backend (cloud functions) that access the DB. It also looks like Firestore is better and has more features than Google Datastore, I wouldn't be suprised if it replaces Datastore in the future.

In any case I definitely have use for a cloud firestore nodejs ODM. So +1 for me.

@sebelga
Copy link
Owner

sebelga commented Dec 2, 2018

Thanks for the feedback @delamart I will look more into it then 👍

@sebelga
Copy link
Owner

sebelga commented Sep 25, 2019

Hi,
I'd like to retake the conversation around this. I opened an issue (#190) for the milestone (https://github.com/sebelga/gstore-node/milestone/1) to add support for Firestore native.

Could you share your thoughts in the issues I opened around the API to support both databases? cheers!

@carnun
Copy link
Collaborator

carnun commented Jan 13, 2021

Hi,
Is anyone still interested in something similar to gstore-node which would support Firestore in Native mode?

The data modelling structures for Native mode are a bit different (collections>documents>collections>documents>....) than those used for Datastore mode (kind>entity) so I'm leaning towards rather creating something dedicated to handling Firestore's nested modelling perspective (code name 'fstore-node' ;-). However before going down that road it would be great to explore the uses cases maybe through some pseudo code as to how "fstore-node" (or an adaptor on gstore-node) would be expected to work. If anyone has any ideas please add them into the thread and I'll work through it.

@sebelga
Copy link
Owner

sebelga commented Feb 6, 2021

I think you're right that it should probably be a separate package. As I started working on this, I realized that the naming conventions of Firestore are quite different from Datastore. This means that probably the docs should reflect that? 🤔

As I didn't feel much interest in it I didn't think the amount of work was worth the effort.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants