Jblew / firebase-functions-rate-limiter

Js/ts library that allows you to set per-time, per-user or per-anything limits for calling Firebase cloud functions
MIT License
100 stars 15 forks source link

Does the limiter affect firebase reads/writes? #23

Open purpleh00d opened 3 years ago

purpleh00d commented 3 years ago

The problem with firebase as you might know is that there's really no way to stop users from abusing your db by spamming functions calls. Even if you do stop them, the fact that they still call them might result in a huge bill anyway, which is what really scares me and can put any business out.

So basically, my question is: do I have to be careful about billing anyway, even if I use this limiter?

Also... if I choose Firestore to save that data limit, then there will be a limit of 1 Mb per document, will it be handled by this library or by ourself ?

Thanks

oguzeray commented 3 years ago

its $0.06/100K read after 50K free daily for Firestore. $0.40/1M invocations after 2M free monthly. So if you do you math right, spammers will pay more electriciry bill than your google bill. Let them.

Jblew commented 2 years ago

There are two backends: Realtime Database and Firestore. If you are concerned with costs use the Firestore one. It is optimized for low write count :)