Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firestore limit on updating data about once per second; why do I seem to be able to go past it?

Firestore documentation and the quotas chart show that a document can only be updated about once per second. Why do I seem to be able to update a document more than once per second with no problem?

I tried a simple "for loop" and all writes seem to go through:

 const db = firebase.firestore(firebase.app("prjID"));
 for (i = 0; i < 10; i++) {
     console.log(`updating /test/test with test:${i} ${new Date().getMilliseconds()}`);
     db.doc(`/test/test`).update({ test: i });
 }

log shows : enter image description here

I am wondering if someone knows the supposed server response when multiple write operations are attempted in less than a second i.e, beyond the limit that I seemingly can ignore?

If I am missing something and the limit means something different any explanation?

like image 299
TheeBen Avatar asked Feb 07 '18 17:02

TheeBen


People also ask

What are the limitations of Firebase?

Rulesets must obey two size limits: a 256 KB limit on the size of the ruleset text source published from the Firebase console or from the CLI using firebase deploy . a 250 KB limit on the size of the compiled ruleset that results when Firebase processes the source and makes it active on the back-end.

How do I speed up firestore queries?

One simple option is to add limits to your queries. If you suspect that your user only needs the first handful of results from your employee list, add a limit(25) to the end of your query to download just the first batch of data, and then only download further records if your user requests them.

What is firestore persistence?

Cloud Firestore supports offline data persistence. This feature caches a copy of the Cloud Firestore data that your app is actively using, so your app can access the data when the device is offline. You can write, read, listen to, and query the cached data.


1 Answers

FYI for whoever might wonder about this. This is not a hard limit enforced by Firebase but rather an indication of the system's capabilities. Read more into the answer I got from Firebase here. So if you think you are going to perform thousands of writes to a document in short amount of time then you should think about it. But for a few writes here and there, systems seems to be capable of handling it in timely manner.

like image 56
TheeBen Avatar answered Sep 17 '22 16:09

TheeBen