Firebase-js-sdk: Firestore limit on updating a document about once per second; why do I seem to be able to go past it?

Created on 7 Feb 2018  路  2Comments  路  Source: firebase/firebase-js-sdk

  • Operating System: windows
  • Firebase SDK version: v4.9.0
  • Firebase Product: Firestore (auth, database, storage, etc)

I tried asking in stackoverflow but it seems to be more of a particular question for Firebase team. I seem to be able to update a document in Firestore more than once per second which is explained to be the limit. Am I missing something or the limit seems to be inactive?

Here is part of document showing the limits & quotas.
Here's what I have tried and seems to be able to write more than once per second to one document in Firestore.

  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 });
      }

I have also confirmed in console that data is being updated seemingly for all the writes one after another. Whay do I seem to be able to go past the limit?

firestore

Most helpful comment

@Thkasis this is not a hard limit that we enforce artificially, but rather something we want you to be aware of when using Cloud Firestore as it's a fundamental limitation of the system. If you sustain writes of over 1QPS to the same document, you will eventually run into this limit and your writes will be rejected. If you never go over 1QPS, you should never hit a wall.

If you just fire off 10 writes (like in your example) the backend is able to just queue them and execute them at a sustainable rate. If you tried doing thousands of requests at once you'd certainly see errors.

All 2 comments

Hmmm this issue does not seem to follow the issue template. Make sure you provide all the required information.

@Thkasis this is not a hard limit that we enforce artificially, but rather something we want you to be aware of when using Cloud Firestore as it's a fundamental limitation of the system. If you sustain writes of over 1QPS to the same document, you will eventually run into this limit and your writes will be rejected. If you never go over 1QPS, you should never hit a wall.

If you just fire off 10 writes (like in your example) the backend is able to just queue them and execute them at a sustainable rate. If you tried doing thousands of requests at once you'd certainly see errors.

Was this page helpful?
0 / 5 - 0 ratings