So, while I love Firebase I can't help but feel a bit paranoid.
Looking through old Q&A's regarding Firebase, I have found that in the past they had burstable billing, where only the 95th percentile of usage were being charged. It seems, however, that this is no longer the case.
If I would be so unfortunate to be DDoS'ed, would that mean my bill would increase to an arbitrarily large figure until the attack stopped, as a result of unlimited, automated scaling?
And to the second part of my question. Let's pretend I have a Firestore collection called 'users' containing 10 million documents. Because my service has a feature where you can search for any given user, it is necessary to allow full READ permission. I might retrieve my search results like this:
firestore.collection('users').where('username', '==', 'George').get().then(snapshot => {
// do stuff
});
That would cost me a single read. If someone, for kicks and giggles, decided to inject this into their browser client:
firestore.collection('users').get().then(snapshot => {
// do stuff
});
That would cost me $6 (10,000,000 / 100,000 * 0.06) for 10 million reads. Why would someone do this? Maybe they want to run statistics on all usernames? It doesn't really matter. What worries me, is that someone this easily could run up my bills. I can easily imagine someone getting a kick out of making a Chrome extension that charges me $6 every time someone clicks it! Only a hundred clicks and I'm
Set a monthly budget, you may say? That doesn't so much solve the problem, as it just sets a target for how long my attacker should go on until my service is dead for the remaining month; the work of a competitor perhaps? *puts on tinfoil hat*
To clarify the first part of my question: how are DDoS-attacks resolved? Both technically and billing-wise.
To clarify the second part of my question: if someone injects code and manually performs tens, or hundreds, of millions of reads, how does this affect my bills? Which precautionary measures have been made to avoid this? If any?
Is my paranoia unwarranted? Have I completely missed something? Answers are appreciated.
I understand that similar attacks also could be costly with a traditional LAMP setup. However, the difference is that the damage I am being done in that case is much less transparent, and depending on the setup, the service may just slow down and not increase the monthly bills significantly. And for excessive database reads, there are simply more hoops to jump through, whereas Firebase makes it incredibly easy.