Aman
Aman

Reputation: 3

Will Cloud Firestore reject or re-queue the requests that go beyond the connections and writes per second limit?

My question is, will cloud firestore reject or re-queue requests after these limits?

Maximum concurrent connections 1,000,000
Maximum writes per second per database 10,000

Upvotes: 0

Views: 220

Answers (1)

ctrl freak
ctrl freak

Reputation: 12385

Operations will simply fail when you hit these limits. There is no mechanism to queue and retry operations specifically for these limits beyond the retry mechanisms that already exist in Firestore for things like basic write failures due to network connection errors. But if you're performing something like a batch operation that hits failure, it doesn't matter what the cause of error is, there is no automatic retry built in.

I should note that you aren't guaranteed to hit failure when you go one over a lot of these limits. Firestore's limits are largely physical, meaning that these are the general limits of the hardware itself. Firestore allows for a lot of "burstiness", as they call it, so you can go over a limit for short periods of time but these limits will certainly cause failure when they are sustained.

Correct me if I'm wrong but from all that I've read (and been told from the Firebase team) is that the sustained write-rate limit of 1 document per second is a physical one.

The maximum sustained write rate to a document is 1 per second. You might be able to burst more frequent writes for a short amount of time, but after a while, writes will fail at higher sustained rates.

And in the larger scope (mentioned in the same breath):

You should also know that the maximum writes per second among all documents in a Firestore database is 10,000 per second.

Which, as all of the literature suggests, is also a physical one that requires us to manually work around (as mentioned in the article). And, AFAIK, there is no built-in retry mechanism for this error beyond the retry mechanisms that already exist in Firestore.

https://medium.com/firebase-developers/the-top-10-things-to-know-about-firestore-when-choosing-a-database-for-your-app-a3b71b80d979#:~:text=You%20should%20also%20know%20that,database%20is%2010%2C000%20per%20second.

Upvotes: 2

Related Questions