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

Replace Firebase/Firstore with something better #27

Open
bvaughn opened this issue Jan 1, 2018 · 15 comments
Open

Replace Firebase/Firstore with something better #27

bvaughn opened this issue Jan 1, 2018 · 15 comments
Assignees

Comments

@bvaughn
Copy link
Owner

bvaughn commented Jan 1, 2018

In general, I've found Firebase to be awkward to work with- from authentication to querying.

Its support for compound queries is very limited. For example, it doesn't support logical OR or the "!=" operator, pushing the burden onto the client.

Its authentication model feels awkward too: Sessions aren't persisted between page reloads for some providers (eg Google). I was unable to get Facebook to actually work. etc.

Then tonight while testing the new summary page, I started seeing this error:

FirebaseError: [code=resource-exhausted]: Quota exceeded.
Using maximum backoff delay to prevent overloading the backend.

This app has experienced very light traffic, so the above message is concerning.

Anyway, all of the Firebase-specific code is abstracted away behind DataStore so in theory, it should be easy enough to remove.

I asked for recommendations about this on Twitter some time ago, and based on the responses I got, Graph.cool seems like a good option to consider. This article compares GraphQL to Firebase and touches on some of the pain points mentioned above (like limited querying). Another possibility is AWS AppSync.

@mbrevda
Copy link

mbrevda commented Jan 1, 2018

If you want slightly better queryability, but also the real time factor, have a look at the new Cloud Firestore

@bvaughn
Copy link
Owner Author

bvaughn commented Jan 1, 2018

I've been using Firestore, since (legacy?) Firebase was pretty horrible to use for ordered lists.

@mbrevda
Copy link

mbrevda commented Jan 1, 2018 via email

@bvaughn
Copy link
Owner Author

bvaughn commented Jan 1, 2018

Thanks for the pointer though! I appreciate the thought.

Invested a decent amount of energy trying to get Fire* working for this project but it still feels...limited, awkward, and unintuitive to me.

Oh well. 😄

Happy New Year buddy.

@mbrevda
Copy link

mbrevda commented Jan 1, 2018 via email

@bvaughn bvaughn changed the title Replace Firebase with something better Replace Firebase/Firstore with something better Jan 1, 2018
@bvaughn
Copy link
Owner Author

bvaughn commented Jan 1, 2018

Added download/export option via #7 to support some kind of migration from Firebase to something else.

@bvaughn bvaughn self-assigned this Jan 1, 2018
@bvaughn
Copy link
Owner Author

bvaughn commented Jan 1, 2018

Was thinking to myself that maybe it would be nice to support a couple of backends. I'm not thrilled with Firestore, but at least it works (if you overlook hacks like this). Maybe it would be possible to make an interface for DataStore and support a couple of implementations (Firebase, local storage, Graph.cool, etc.).

Maybe users could select which one to use before signing in (if we bundle-split) or maybe we could make it a build-time step.

This would be more work, and it might not be worth doing- particularly if certain backends support features that others don't. It's just a thought.

@bvaughn
Copy link
Owner Author

bvaughn commented Jan 3, 2018

I think I've run out of patience with Graph.cool, unfortunately. The docs seems to be wrong in so many places- either outdated (referencing functions/libs that don't exist anymore) or the code they show in the tutorial fails when run in the Playground, etc...

It looks like a nice service in many ways, although the auth example is pretty heavy on the boilerplate. I just don't have the time or patience to sort through the docs at the moment, since this is a side project.

@dandv
Copy link

dandv commented Feb 20, 2018

I also got this error while being the sole user of an app with at most 1 insert per second from the server.

FirebaseError: [code=resource-exhausted]: Quota exceeded.
Using maximum backoff delay to prevent overloading the backend.`

Firestore is still in beta, and writes are capped to 1 per document per second, so that might have triggered the error.

@joshpitzalis
Copy link

joshpitzalis commented Apr 27, 2018

This warning just means that you guys have maxed out your free daily quota of reads and writes, you either need to bump up to a paid plan or wait a day for the quotas to be restored.

@bvaughn
Copy link
Owner Author

bvaughn commented Apr 27, 2018

Yeah, but as the issue description mentioned- the traffic/load for this app was super minimal to have already bumped up against the free tier limit. 😊

@joshpitzalis
Copy link

joshpitzalis commented Apr 27, 2018

It's not just traffic. There are a whole host of things that you could've maxed out if you're using apis, cloud functions, storage, etc. If you check the usage tab on firestore/rtdb next time it happens it will take you to a dashboard that shows you exactly what maxed out.
app_engine_quotas_-_smart_spin_dev

@bvaughn
Copy link
Owner Author

bvaughn commented Apr 27, 2018

I was using the word "traffic" very broadly to mean reads and writes. The amount of data actually stored by this app is very small.

But good suggestion, thanks for mentioning the usage tab. 😊

@ronnieroyston
Copy link

Google Cloud Datastore offers free quota that allows you to get started at no cost. The resources and free quota amounts are listed below. If you need more quota, you must enable billing and set a spending limit for your project.

Quotas are applied daily and reset around midnight Pacific time.

image

@thevzurd
Copy link

thevzurd commented Mar 3, 2019

Is there a limit on Cloud messages as well ? I cant find any documentation on the quota of messages.

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