Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to limit Firebase's Blaze plan?

I'm currently working in a social network app and I need to do a search feature. Firestore does not support these kind of queries, so I need to use an external service like Algolia.

The problem is that the free plan does not support connecting to external websites/APIs other than Google's own ones, so I can't connect to Algolia to get my search system working.

I have read multiple stories about devs paying high bills because of loops or errors in their code, and as the Blaze plan is a pay-to-go plan, they get charged what they used. If a loop generated 10TB of files they will get charged for that.

I also know that Blaze plan's features are free as long as each of them (individually) stay below the limits of the free Spark plan.

So as my question says, is there a way to set limits? For example, I would like to tell Firebase to limit my cloud functions invocations to 100k per month. That way it would be free and I would never be able to get over 100k as it's limited, which means I'll never get billed for that.

Take into account that the only thing I need right now from a paid plan is the connection to external networks. I don't need anything else as we're just starting and the app is not in production, so there's no need for huge limits.

like image 626
Franco Muñiz Avatar asked Sep 14 '18 02:09

Franco Muñiz


People also ask

Is there a limit on Firebase projects?

Firebase imposes hard limits on the number of simultaneous connections to your app's database. These limits are in place to protect both Firebase and our users from abuse. The Spark plan limit is 100 and cannot be raised. The Flame and Blaze plans have a limit of 200,000 simultaneous connections per database.

How do I reduce the cost of Firebase?

The simplest way to reduce the cost is by reducing the downloads. You can do that by caching the data on local storage as much as possible and continuously sync sensitive data.

How do I limit firestore?

To cap your Cloud Firestore usage, set a daily spending limit through App Engine. App Engine allows you to set a daily spending limit on App Engine associated resources, including Cloud Firestore. The App Engine limit does not apply to any other Firebase products.

Can Firebase handle 10 million users?

The limit you're referring to is the limit for the number of concurrently connected users to Firebase Realtime Database on the free Spark plan. Once you upgrade to a payment plan, your project will allow 200,000 simultaneously connected users.


1 Answers

Every Firebase project is also a Google Cloud Platform project. This means that many of the advanced features of Google Cloud Platform are also available for your Firebase project.

For example, you can set up billing alert for your Firebase project, so that you are alerted when the usage reaches a certain level. While you can't configure it to switch off the project at some point, the alert should typically be quite good for alerting you to unusual usage patterns.

For more on this see:

  • Tracking your spending with budgets in a recent blog post.
  • The GCP documentation on how to set budget alerts, which is what Firebase uses under the hood.

The GCP documentation now also has a section on capping (disabling) billing to stop usage. This is a brute force approach though and may lead to data being lost, so I'd recommend investigating all other options first.


Update (December 2020): Firebase's Todd Kerpelman just released a series of videos where he disables billing using the process from the documentation mentioned above.

like image 81
Frank van Puffelen Avatar answered Sep 20 '22 20:09

Frank van Puffelen