Live data from Hacker News

How not to get a $30k bill from Firebase

medium.com

31–40 of 114 posts

Re: How not to get a $30k bill from Firebase

#31
post #29
post #20

Junior millennial hipster developers just discovered SELECT N+1 problem the hard way

No PaaS provider costs their DB instances on number of selects... Perhaps you're the Junior developer?!

From TFA: "Firebase, however, charges based on per 100k — 250k read, write and delete requests to the database."

Re: How not to get a $30k bill from Firebase

#32
post #23

I really wish cloud providers would allow users to set a hard budget that just stops the service if you exceed a threshold. I got a surprise bill from AWS this month (fortunately orders of magnitude less than this, but still ~15x my usual) and am thinking of moving from Lambda to a VPS just so the possibility of this doesn't keep me up at night.

You can? I have daily limits for my Google App Engine apps.

Re: How not to get a $30k bill from Firebase

#33
post #20

Junior millennial hipster developers just discovered SELECT N+1 problem the hard way

How did you manage to make that a “millennial” thing

I think the point he's trying to make is that even with a selection of highly "en vogue" PaaS and frameworks, you still run up against basic problems in Computer Science, and that all the fancy frameworks can actually obfuscate the source of the problem. The sentiment seems to be "perhaps you could have done this with basic tools and not made the error, rather than using something trendy".

And millenial ~= trendy.

Re: How not to get a $30k bill from Firebase

#34
post #14

Earlier quoted context omitted.

You can press the X to close the “Pardon the interruption” overlay that asks you to sign in.

I also seem to have to pay 5$ a month now, I can get past it with some element hiding and cookie clearing but seems like medium is not the ideal solution anymore

> seems like medium is not the ideal solution anymore

It never was.

Re: How not to get a $30k bill from Firebase

#35
post #29
post #20

Junior millennial hipster developers just discovered SELECT N+1 problem the hard way

No PaaS provider costs their DB instances on number of selects... Perhaps you're the Junior developer?!

Pretty much every PaaS provider does that. If you're exceeding the number of queries a node can process you either need a bigger node or more nodes, therefore the amount you have to pay is directly related to the number of queries you send. The only difference is that firebase automatically adds more nodes behind the scenes which makes surprise bills possible. If you're not adding more nodes, your application simply stops serving requests reliably because your DB is overloaded. Therefore the actual problem is not the billing model, it's the fact that the code is crap.

Re: How not to get a $30k bill from Firebase

#37
post #12

Earlier quoted context omitted.

block cookies on medium.com domain, seems to work OK

Yeah I can get passed it but damn it's become a mess, I understand they have to make money.

It seems we have a pretty fucked up cycle here:

* Create quality service, prioritizing user experience over money

* Grow site to significant user base

* Start running out of money, because hosting and running a site does cost money

* Try to monetize service

* Get out-competed by another service still at step 1

The presence of VC money that's all about capturing market share now, and monetizing later does not help.

In the end, we have become accustomed to a world where things that cost money are given to us for free. When there are attempts to charge us so things remain sustainable, we get angry! It's a tough problem, and I don't know the solution.

Re: How not to get a $30k bill from Firebase

#38
post #3
post #2

TLDR: The huge bill was a result of an improper way the application was coded. They contacted Google/Firebase who were gracious enough to waive off the bill.

Glad to hear that Google has done something with it. Also that's one of the reasons I try to use the realtime database, and not firestore. But they still charge for bandwidth there (most if it is consumed by downloading the SSL certificates from the clients).

This must be the first time I hear about Google responding timely and adequately to a specific problem of a customer. Could the publicity have something to do with it?

Re: How not to get a $30k bill from Firebase

#40
post #23

I really wish cloud providers would allow users to set a hard budget that just stops the service if you exceed a threshold. I got a surprise bill from AWS this month (fortunately orders of magnitude less than this, but still ~15x my usual) and am thinking of moving from Lambda to a VPS just so the possibility of this doesn't keep me up at night.

I think there'd be two big issues - (1) what is reasonable behaviour when you reach your budget, and (2) the consistency of billing.

On (1), if you get to say the 14th of the month and run out of budget, what would be the expected behaviour? - shut down all your services? delete all your data so that's not incurring a charge too? It'd probably have to be configurable on a service by service basis, and that's an awful lot of complexity to introduce for a tiny minority of their revenue base.

On (2), their billing systems are almost certainly eventually consistent in logging and charging usage, so they'd either have to shut you down early in anticipation of delayed charges, or let any delayed charges bring you over budget. Either is liable to make customers fairly unhappy one way or the other.

The TL;DR version - it'd be nigh on impossible to have good UX with such a feature, would be complicated to implement, and it's not likely to move the needle on any metric they really care about considerably.

Post reply on HN