Reputation: 713
According to the Firestore documentation, Firestore has a soft limit of 500 writes per second when writing documents with indexed sequential data to a collection. Does Firestore have any similar restrictions for categorical data?
For example, will the maximum write speed to a collection be reduced if the documents I am writing have an indexed field "category" with possible values of 1, 2, 3, or 4.
Upvotes: 1
Views: 104
Reputation: 317352
Since the documentation is silent on this matter, you can assume that no such limit exists. The documented limits are intended to be comprehensive.
The reason for sequential data being limited is due to the fact that the writes to the underlying index are limited by "shards" (or ranges of values covered in a single unit). While you can have any number of documents in Firestore, the internal sharding of the indexes cannot scale under heavy write load. Heavy writes to a single range of values is effectively "hotspotting" that shard, and is therefore limited by the underlying physical infrastructure for that shard. Once the underlying shard capacity is hit, it is eventually fragmented into smaller shards. All this happens internally and without notice. You just have to accept the limit on sequential data.
(Or, to think about it another way, wouldn't it be completely unusable if boolean true/false "categories" were limits also in this way?)
Upvotes: 1