Understanding Firebase Costs
A Firebase guide to understanding pricing, managing costs, and tracking usage.
Last updated
Was this helpful?
A Firebase guide to understanding pricing, managing costs, and tracking usage.
Last updated
Was this helpful?
Firebase is a mobile and web app development platform that helps you build quickly and handles a lot of fundamental infrastructure tasks such as database management, hosting, serverless functions, messaging, and monitoring.
An ongoing concern for Firebase users is cost since Firebase's model is confusing and difficult to track accurately. If you search Google for "Firebase costs" you'll see a lot of horror stories about large unexpected bills. However, with a little knowledge and , you can monitor and manage your Firebase costs so you don't get into trouble.
Firebase offers two plans: Spark and Blaze.
The Spark Plan is Firebase's free tier with a very allocation offering. The plan is fantastic for startups or those looking to do MVPs. You can set up an entire website or mobile app with a database, messaging, cloud functions, authentication, and a custom domains with SSL for free and have a significant number of users (depending on your app requirements).
No credit card is required to sign up and you will never incur a bill. While that sounds great, it is also part of the danger of being on the Spark Plan.
When your Spark plan's free daily or monthly usage runs out, the Firebase APIs will start refusing requests. Without warning your app can shutdown.
If you have a mission critical app or don't want your app to suddenly shut down, consider to the Blaze plan.
There are also some restrictions on the Spark plan; for example Cloud Functions can only make API calls to Google APIs. So if you need to fetch from a non-Google service, you'll need to upgrade to the Blaze plan.
The Blaze plan is pay-as-you-go and requires you to set up billing with a credit card. It is made for larger scale apps or when you can't afford to exceed your free quota and have your app shut down.
You are charged based on your storage and usage of Firebase, so you only pay for what you consume. You still get your free allocation and will only be charged once you go over your quota. Some occur daily, such as Firestore reads, or monthly, such as Cloud Function invocations.
However, with your Blaze plan, you can set setup limits and budget alerts, which we'll discuss below.
In the Firebase console you can see a lot of details about your current month usage and spend.
In your Firebase console, click on the gear icon in the upper left corner and select "Usage and billing".
You will see your estimate project costs for the current month broken down into Cloud Firestore, Functions, and non-Firebase services.
Previous month usage details are not available in the Firebase console. You need to go to the Google console to see historical data.
Also, the free tier section is missing several usage metrics that you are charged for such as Firebase storage, Cloud Function invocations, and network egress.
Below the Project costs graph is a section called "Free Tier" of your usage per features (e.g. Firestore) and the percentage of you're free tier used so far.
As noted above, if you're on the Spark plan, you need to carefully track how much of your free quota has been used. If you hit the limit, Firebase will stop accepting API requests. In the example above, once the 1 GB Hosting storage limit has been hit, you will no longer be able to release new code without deleting old ones or moving to the Blaze plan.
Finally each section under "Develop" on the left side-panel has a "Usage" tab that show the top metrics for the given functionality. Below is an example of the Database (Realtime DB) usage.
Setting a budget is a smart move if you're on the Blaze plan. Setting a budget requires that you have billing setup up in the Google Cloud Console (i.e. you're on the Blaze pay-as-you-go plan).
Behind the scenes, Firebase runs on top of Google Cloud. The Google Cloud Console (GCC) is the means by which you access and manage the cloud functionality. Here you can dive into the gory details of usage and billing by taking a look at the man behind the curtain (Google Cloud).
As before, go to "Usage and Billing" by clicking the gear icon in the left side-panel.
Hover or click the "Beta" tag and then click the "Google Cloud Console" link.
The Google Cloud Console is a large app with a lot of functionality. We will not cover all the capabilities here, except for one: Reports. Report are useful to see where your cost are for a give function.
Open the console Navigation menu (menu), and then select Billing and then Reports
In Report, you can select the time period and "Products", such as Firestore, you want to filter on. You will be able to view the break down of cost over the course of the month. Unlike in the Firebase console, here you can view your historical data.
A few tips on how to approach Firebase costs and usage.
A great video from Firebase that reviews not only Firestore pricing, but overall Firebase pricing.
An in-depth discussion on how Firebase relates to Google Cloud.
Under "Usage and billing" click the "Details and Setting" tab. There you will see a card with a link to Google's console's budgeting too. Click the link and you'll be brought in to the Google Console .
You can also set a that is a one set process.
👉
Billing Questions: You can reach out to the directly.
Cost calculator on Pricing Page: The calculator at the bottom of the page is inaccurate. For example, it indicates that 600,000 monthly Firestore writes are free. In fact you only get 20,000 free writes a day (and $0.18/100K after). If you write 120,000 in a day you will be charged $0.18 even if your monthly is below 600,000.
Use Caching: Firestore allows you to use . Request go to your local cache instead of the server, thus reducing the number of billable reads.
Set Firestore Spending Limit: Google stopped offering back in 2019. If you're on the free Spark plan and you hit your daily Firestore read limit, you will be blocked from additional reads until the following month or you upgrade to Blaze.
Firestore Security Rules: Believe it or not, but certain Firestore security rules count as reads. f you use exists()
, get()
, or getAfter()
, you are charged for additional reads for the query running, docs return for the evaluation, or updating the rule. See the list.
Firestore Pricing Depends on Location: Where your server runs changes your quota limit and pricing. Use to see for your location.
👉
Head back to your 🔥 🔥to see you usage and spend.
Please or with us for any questions or comments