August Jelemson
August Jelemson

Reputation: 1218

Monitoring reads (per user) in Firebase

I have thought about monitoring reads for users in Firebase.
Let's say that a user makes a lot of "reads", then I will monitor these "reads" by writing to a counter in a separate document. Once the user has reached 104 reads I will tell the user that they have reached their daily quota. In such a case I also want to disable them from making any further reads (for a day), is this possible in Firebase?

Upvotes: 0

Views: 220

Answers (1)

Brian Burton
Brian Burton

Reputation: 3842

No, that's not currently possible. At least not in any secure way that would prevent the user from manipulating the value.

Your best solution at present would be to use Firestore or RTDB as a non-public database and then create an API behind the API Gateway to handle your rate limiting. Then reads go through your API giving you much more control but of course involves losing realtime updates.

Upvotes: 2

Related Questions