Skip to main content

My story of infinite loop on firebase...

 

 So recently I heard the news of a startup "Announce" getting a bill of $72k and almost bankrupting them in the process.


Story can be found here.

When I heard the news I was thinking about the same mistake that was made by me.


if you are a programmer, chances are that you heard about good old recursion. Recursion is a powerful strategy for solving problems, but with great power comes of course great responsibilities. Missing an edge case in a recursion can cause a huge conundrum and your resources getting exploited pretty quickly, all thanks to the infinite recursion that's been happening on the background.

Now in the cloud, recursion is little bit of the same line but brings forth another set of problems as well.
In my case, I wrote a cloud function in firebase, that will update the date of a set of documents inside a particular collection when data is being **modified** in the same collection. Yes I know, dumb! I thought of making the cloud function such that when new data is being **added**, please update the date. But lucky me, instead of **adding**, I put **update**.

And that cause recursion of it's own.
But I was lucky enough, such that at the time of programming, in order to use a cloud function I didn't needed a credit card (which is not the case as of now!).

But this is just an absolute dump move, from a newbie in cloud computing. Which indicates that even a newbie should be pretty careful to use the cloud features with its upmost care.

Even experienced devs, accidentally introduced cloud recursion that gave them huge amount of bills.

So next time you use a cloud service, make sure that you enable the option to trigger an action while your bill reaches a certain amount. Most popular cloud services like AWS, and GCP provides this feature.

Comments

Popular posts from this blog

AI. Will it replace us or...?

AI!! The buzzword is too hot in the market nowadays. Do you have a technical product or an idea? If it doesn't have AI in it, then chances are it's not going to be sold like hot cakes. That is how things have changed lately. It is no wonder why me and my colleagues at Gelato want to see what AI can do in a niche department like customer support and service. And that is exactly what we did. For a company like Gelato, which is in the market for production-on-demand, there are a lot of customer questions you need to answer. It can be related to products, queries about shipping and pricing, and so on and so forth. Thus, our customer support team is always happy to help with these recurring questions. Let's take one example. A customer asked us, "Do you ship to Norway?" Now that is an easy question to answer if you have the knowledge written somewhere where you could refer to it and say, "Yes! As a matter of fact, we do." Following the same thread, the next q...

A smoooooth operation....

 Backward compatibility...   A word that I used to hear when I started my career. You design your APIs with backward compatibility in mind, don't break anything when you are upgrading, think about this, think about that etc. Well, those teachings from my previous mentors didn't go in vain, as I made a fundamental change in how we report problems @  Gelato .    You see recently @  Gelato , the CS (Customer Support) team moved from A ticketing management system to B ticketing management system, which is a monumental task for all the people involved in the CS team. Even though the fundamental concept remains the same the places, the attributes the concepts, and the naming of different attributes all change if you have this transition. And thus it was a big change for the whole company.    After the decision was taken, the first step was to create a well-written transition document, which the good folks at the CS team tackled. Special thanks to  ...

My first ever podcast...

 I travel almost one and a half hours a day. It was such a waste of time for me, going through the same roads, travelling the same distance all day. There was no time left for me after my office hours for anything new. Then I got the idea of podcasts. I started listening to name a few and fell in love with the idea of it. I started searching for the best podcasts on the internet and found out one gem, which was released back in April 2018. "The Caliphate", by Rukmini Kallimachi. Rukmini Callimachi is a Romanian born American journalist who is working for The New York Times. Back in 2014, she started her reporting on Islamic extremism and then focused on Al Queda and Islamic State of Iraq and Syria (ISIS). after years of research and study and battling through tough times of reporting, she published a podcast series named "The Caliphate" back in April 2018 with proofs of her findings and the way she got them. "The Caliphate" was a series focused mainly on a...