User quota enforcement in Firebase

What is the best way to apply user quotas for data stored in Firebase?

My users will be able to create documents with a unique identifier in the following way:

/ documents / ID / content

The identifier will be uniquely generated using the transaction. The identifier will be reserved using the validation rule ( contents.id == auth.id )

However, how can I prevent user db spam (by randomly distributing identifiers for myself)? Can I have a rule that counts the number of identifiers allocated to a user and rejects them if the counter is too high?

+4
source share
1 answer

There is currently no good way to do this.

In some cases, you can completely list the children who are allowed to exist (child1, child2, etc.) and provide a read / write for each of them. This will not work for large numbers, though, or for identifiers that you do not know in advance.

We have plans to create features to limit the number of children allowed and provide other features to enforce user quotas.

+1
source

All Articles