As the title say: What is the maximum number of Firebase shards we can have?
I just realized that one Firebase database is not going to cut it for my project, because the real-time DB price scales very harshly. I could avoid the issue by having one main DB where I go on Blaze and a very large amount of small DB instances on spark. Alternatively, I could use storage (which scales much better), but I'd have to do some significant change in how my program works.
There is an undocumented limit to the number of projects you can have on the free/Spark plan. The number depends on the reputation of your account on the Google Cloud Platform. Since Firebase projects are also GCP projects, the limit covers both your Firebase and (plain) GCP projects.
There is no known limit to the number of projects you can have on a paid plan.
Related
I'm using Firebase on Flutter, and I have a question.
I use the .getDownloadURL() function to get the URL of the image uploaded to the FireStore and display the image in the app as a NetworkImage(url) function.
At this time, will the firebase cost be charged?
Summary:
flutter > .getDownloadURL() > NetworkImage(url)
I'd like to know if the cost will be incurred at this time.
Please check.
Yes, beyond the free plan, downloading data from Cloud Storage through Firebase is a charged operation.
As shown in the Firebase pricing, you will be charged for the number of download operations, and for the amount of data downloaded.
Firebase has two pricing levels. The first one incorporates a limited Free tier, and it’s an excellent option for development and small applications. The second tier works on a pay as you grow model, and it’s ideal for production applications. Hopefully this will help you.
Spark Plan (Firebase free tier) is a basic plan offering 1 GB total storage, 20K writes/day, 50K reads/day, and 20K deleted/day
Blaze Plan (paid) is a pay as you go plan charging $0.18/GB for database storage, $0.026/GB for application storage, and additional charges for database operations, data transfer, etc.
I am using firebase realtime database.
The project works like a chat application.
We are constantly downloading / uploading.
But the cost seems too high. All data is downloaded again every get 1 message. What can I do to reduce the cost of this?
Instead of downloading data again every time I think of creating a cache. What should we pay attention to when creating the cache?
What are the solutions Firebase offers to reduce cost for realtime database?
Thanks, best regards
The pricing page of Firebase is pretty clear. The cost for the Realtime Database is based on:
The amount of data you store in the database.
The amount of data that is read from the database.
So those are the two factors you'll need to pay attention to if you want to reduce the cost.
Which one has the highest impact really depends on where your cost is coming from, which you didn't say. But the most common one is to look if you can reduce the number of times each client downloads the same data by local caching. If you're using the native mobile SDKs for iOS and Android (which you also don't mention), you can often already accomplish some reduction by enabling disk caching.
I found online that firebase can only handle up to 100 users. Does this mean that after 100 users sign up, you will be forced to switch to a higher plan? That seems like a very low user count.
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. This is not the total number of users, just the number of them that are currently running your app. This limit does not apply to other Firebase products (there are over a dozen).
I suggest reading over the pricing page carefully to understand the limits for paid and unpaid projects, for each of the individual Firebase products.
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.
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.
You cannot set spending limits to your app now.
As of December 12, 2019, you can no longer create spending limits, but
you can change or remove existing spending limits.
https://cloud.google.com/appengine/pricing#spending_limit
You can create budgets, which will alert you when reaching the budget. But it won't stop the usage when hitting the budget.
https://cloud.google.com/billing/docs/how-to/budgets#add-new-budget
The screenshot here seems to show a Spending Limit setting for Firebase projects: Firebase: Budget and Daily Spending Limit
That settings page is located here (the Spending Limit setting apparently only shows up once you set up billing for the project): https://console.cloud.google.com/appengine/settings
It's disabled in the poster's case, but I think that's only because he connected it up to a "NodeJS App Engine app", which isn't the case for many Firebase developers.
I haven't tried it yet myself, but will do so once I start a paid plan.
EDIT: Yep, the setting shows up once you switch to a paid plan. (in my case, Blaze) I don't have enough traffic yet to confirm that it works as expected, but if I find later that it doesn't, I'll give an update here.
"This example shows you how to cap costs and stops usage for a project by disabling Cloud Billing. This will cause all Google Cloud services to terminate non-free tier services for the project."
Google Cloud Source
Everything here https://firebase.google.com/pricing/ that says "/GB" in Blaze plan, if I have less than GB will the price be calculated lower (like Amazon Web Service's) or billed as full GB?
Want to move from AWS but my app has rather small database/storage but requires large amount of access that it exceeded Spark plan. It would be a shame if Firebase bill me full $5 for realtime database that have barely anything. (In that case stick with AWS might be better)
I know this should go to their support but unfortunately this page https://firebase.google.com/support/ told me to come here, and their direct support is capped at 5 times per year..
Prorated. Calculated lower.
Storage charges are prorated on a per-object basis
https://cloud.google.com/storage/pricing
(referenced as "2) This is the estimated pricing for common usage. Firebase Storage free limits are enforced daily and refreshed at midnight Pacific Time. In the Blaze plan, fees for Firebase Storage are based on usage volume. Firebase Storage usage fees are processed as Google Cloud Storage usage fees. For more information, see Google Cloud Storage Pricing." in the fine print)