logo
Firebase - Interview Questions and Answers
How does Firebase pricing work?
Firebase Pricing Model

Firebase offers a pay-as-you-go pricing model with two main plans:

  1. Spark Plan (Free) – Ideal for small projects.
  2. Blaze Plan (Pay-as-you-go) – Charges based on usage.

Firebase Services & Pricing Breakdown
1. Firestore (Database)
Feature Spark (Free) Blaze (Pay-as-you-go)
Reads 50,000/month $0.06 per 100,000
Writes 20,000/month $0.18 per 100,000
Deletes 20,000/month $0.02 per 100,000
Storage 1GB Free $0.18 per GB/month
Network Egress 10GB Free $0.12 per GB

* Optimization Tip: Minimize reads by using caching, pagination, and selective field queries.


2. Realtime Database
Feature Spark (Free) Blaze (Pay-as-you-go)
Simultaneous Connections 100 200,000+
Data Storage 1GB Free $5 per GB/month
Download Costs 10GB Free $1 per GB

* Optimization Tip: Use Firestore for scalable queries; Realtime DB is better for frequent real-time updates.


3. Firebase Authentication
Feature Spark (Free) Blaze (Pay-as-you-go)
Email/Google/Auth Providers Free Free
Phone Authentication 10K verifications/month $0.01–$0.05 per verification

* Optimization Tip: Prefer email/password for authentication to reduce costs.


4. Firebase Cloud Storage
Feature Spark (Free) Blaze (Pay-as-you-go)
Storage 1GB Free $0.026 per GB
Download (Egress) 10GB Free $0.12 per GB

* Optimization Tip: Use compression, optimize file sizes, and store images in lower resolutions.


5. Firebase Hosting
Feature Spark (Free) Blaze (Pay-as-you-go)
Hosting Storage 10GB Free $0.026 per GB
Bandwidth 10GB Free $0.15 per GB

* Optimization Tip: Use caching, lazy loading, and CDN for lower bandwidth usage.


6. Firebase Cloud Functions
Feature Spark (Free) Blaze (Pay-as-you-go)
Invocations 2M Free/month $0.40 per million
CPU & Memory 400K GB-seconds Free $0.0000025 per GB-s
Network Egress 10GB Free $0.12 per GB

* Optimization Tip: Use scheduled functions to batch tasks instead of triggering functions too frequently.


7. Firebase Cloud Messaging (FCM)

* Unlimited free push notifications across Android, iOS, and web.


Key Cost Optimization Tips
  1. Minimize Firestore Reads – Avoid unnecessary reads; use indexing, pagination, and caching.
  2. Optimize Cloud Storage – Store smaller images and use caching/CDN.
  3. Monitor Cloud Functions – Avoid too many invocations; batch tasks.
  4. Control Network Costs – Reduce egress by keeping requests within the same region.
  5. Use the Firebase Free Tier – Many services offer generous free limits.