google-cloud-firestorelimitscalability

Firestores 10 000 writes/second limitation


I am building an app using firestore at the moment. Google is always promoting firestore for its scalability, but I don't think a 10 000 writes/second limit fits that promise. If you store user likes, notifications and what not in firestore you can easily exceed that limitation i guess. Is there something I am missing? Does this limit only apply to new documents or also to updates of documents?

Thanks in advance.


Solution

  • Firestore is made for hugely scalable read operations. Specifically, its main claim to fame is that running the a specific query will take a fixed amount of time, no matter how much data is in the collection(s) that you're querying. So if you're reading 10 documents from a collection that contains 10K documents and it takes (say) 1 second, you're guaranteed that the same read (under the same client conditions) will take 1 second when there's 10M documents or 10B documents in that collection.

    The write throughput limits for Cloud Firestore are mostly determined by physical limitations. The 10K documents/sec is one, but you're more likely to encounter the limit of being able to write to each document roughly once per second. The reason fro these limits lies in Firestore's other guarantees. For example: Firestore guarantees immediate consistence of your write operations; so that once the write operation completes, no client will be getting older data from the server. To allow this it has to update to all indexes for the data in multiple data centers before confirming the write, which simply takes a certain amount of time, which in turn leads to the limits it has on write throughput. Similarly there are other limits that stem from these choices.

    If you need higher write throughput and are willing to accept different performance guarantees, you may want to look for another database that meets those needs.