Development

How We Saved $2000/Month on Firebase Costs for Our Clients

Without Downgrading Performance

firebasecost-optimizationcloud-computingperformancefirestorecloud-functionspub-subcloud-runauthenticationcase-study
Dezoko Team
โ€ข
January 16, 2025
โ€ข
6 min read

Table of Contents

How We Saved $2000/Month on Firebase Costs for Our Clients

๐Ÿ’ฐ How We Saved $2000/Month on Firebase Costs for Our Clients


(Without Downgrading Performance)


If you're using Firebase, chances are you've felt the sting of surprise billing -- especially when your app scales.


At Dezoko, we've helped multiple startups and SaaS platforms cut their Firebase costs by up to $2,000/month, all without sacrificing performance or user experience.


Here's exactly how we did it -- and how you can do the same.


๐Ÿ” Step 1: Audit Firestore Read Patterns


The #1 hidden cost in Firebase is excessive Firestore document reads.


โŒ Before Optimization:


One client was using Firestore like a SQL database -- querying nested documents without pagination or projections.


  • Reads per user session: ~250
  • Monthly bill (Firestore only): $1,050+

โœ… After Optimization:


  • We denormalized data for fast access
  • Used composite indexes for targeted queries
  • Introduced shallow reads + pagination
  • Reduced reads per session to ~30
  • New monthly cost: ~$320

๐Ÿ“Š Savings: Over $700/month from Firestore alone.


๐Ÿ”„ Step 2: Replace Realtime Triggers with Pub/Sub


Firebase Cloud Functions triggered on Firestore writes are convenient but costly.


  • They auto-scale too aggressively
  • Execute on every tiny data change
  • Hard to batch or debounce

๐Ÿ’ก Our Solution:


We rewired event flow to use Pub/Sub + Cloud Run, which gave:


  • Fine control over batching & retries
  • Scheduled workers (Cloud Tasks)
  • Lower cold start times

๐Ÿ“‰ Result: ~$500/month saved by moving just 3 critical workflows.


๐Ÿง  Step 3: Move Heavy Tasks Off Firebase Functions


One client ran image processing and PDF generation inside Firebase Functions -- causing:


  • Long execution times
  • High billing due to memory use
  • Cold starts on every user action

๐Ÿš€ Fix:


We containerized the logic and deployed it to Cloud Run:


  • Auto-scaled on demand
  • Cached with Cloud Storage
  • Used concurrency to handle batch jobs

โšก Performance improved

๐Ÿ’ต Saved $350+/month


๐Ÿ” Step 4: Optimize Firebase Authentication Usage


Firebase Auth is mostly free -- but we've seen costs climb due to:


  • Email link sign-ins triggering multiple calls
  • Unused anonymous accounts piling up

What we did:


  • Disabled anonymous sign-ins
  • Cleaned up unused accounts monthly
  • Debounced Auth trigger-based workflows

Result: $100/month saved and tighter user management.


๐Ÿงพ Final Results


Before
After
Monthly Savings
$2,720
$690
โœ… $2,030

๐Ÿ“‰ Before & After Breakdown


Here's the cost breakdown chart you can embed in your blog:


๐Ÿ“Š Firebase Monthly Cost Optimization Breakdown


The optimization resulted in significant savings across all Firebase services while maintaining or improving performance.


โœ… Final CTA


> ๐Ÿ’ก Worried about Firebase or GCP costs eating your margins?

> We specialize in optimizing infrastructure and cutting costs without slowing you down.


Get a free consultation