Supabase: The Predictable Optimizer's Dream
Supabase doesn't fuck around with complicated usage metrics like the others. You pay for compute, storage, and bandwidth. That's it. No hidden bullshit. Here's what I've figured out after a year of dealing with their billing:
Spend Caps Actually Work (Unlike Budget Alerts That Just Mock You)
Turn on spend caps immediately. Firebase's budget alerts are fucking useless - they email you after you've already blown your budget. Supabase actually stops service when you hit the cap.
I set ours to about 150% of expected usage. Good thing too - our staging env got stuck in some kind of loop pulling data and would've racked up maybe $380 in charges. Instead it hit the cap at $50 and just stopped working. Annoying, but not budget-destroying.
Micro Instances Can Handle More Than You Think
Don't fall for their upselling bullshit. I'm running about 12k DAU on just the Micro compute addon - $10/month. Yeah it gets a bit slow when we have traffic spikes but most of the time it's totally fine. Their dashboard actually shows you real CPU usage so you can tell if you need more power instead of just guessing.
The usage dashboard is way better than Firebase's confusing cost breakdown that makes zero fucking sense.
Database Storage Optimization
Supabase storage is cheap as hell compared to PlanetScale, but it still adds up:
- Archive old data using pg_partman for time-based partitioning
- Use PostgreSQL compression for large text fields
- Regular VACUUM ANALYZE to reclaim space from deleted records
- Optimize indexes - each unnecessary index costs storage and slows writes
Real-Time Connection Management
Real-time subscriptions can consume unexpected resources. Limit concurrent connections per user, implement connection pooling client-side, and use presence feature sparingly - it's resource-intensive.
Firebase: Taming the Usage Beast
Firebase bills you for every single fucking operation and somehow their cost dashboard makes it impossible to figure out what's actually expensive. Plus they have this shitty thing where real-time listeners trigger cascading reads that aren't obvious until you get the bill.
Firebase's Query Optimization Is A Pain In The Ass
Firestore charges about $0.06 per 100,000 reads which sounds reasonable until you discover that clicking a "like" button somehow triggers 35 document reads. Had to trace through our code with the Firebase console open to figure out where all these reads were coming from:
- Use composite queries instead of multiple single-field queries
- Implement pagination with limit() - never fetch more than you display
- Cache query results client-side using Firebase caching
- Use real-time listeners judiciously - each update triggers new reads
Cloud Functions Will Eat Your Budget
Cloud Functions pricing is sneaky - it's not just invocations, it's compute time and memory too. Cold starts are expensive and happen more than you think.
We moved our image processing functions to Cloud Run because Functions was bleeding us $150/month for what should've been simple fucking tasks. Cloud Run handles the same workload for around $65.
Pro tip: functions default to 256MB memory but most only need 128MB. Firebase doesn't tell you this, so you're paying double for memory you're not using. Check your function metrics - if you're consistently under 128MB usage, downgrade the memory allocation.
Storage and CDN Optimization
Cloud Storage pricing varies significantly by region and access pattern:
- Use regional storage for frequently accessed files
- Implement lifecycle policies to move old files to cheaper storage classes
- Enable CDN caching to reduce egress charges
- Compress images before upload - Firebase doesn't do this automatically
PlanetScale: High-Performance Cost Engineering
PlanetScale costs way more than the others but you know exactly what you're paying for. Storage is $1.50/GB which is pretty steep - like 10x what you'd pay for Supabase storage.
PS-10 Is Actually A Decent Deal (If You Use It Right)
PlanetScale forces you into 3 instances minimum for production (1 primary + 2 replicas). The PS-10 at $39/month includes all three, which is reasonable for small workloads.
The thing they don't emphasize is that database branches consume storage too. I heard about one team that had like 12 dev branches sitting around for months and got hit with an $800 storage bill. Ouch.
The PlanetScale CLI doesn't warn you about costs when creating branches. You just run pscale branch create my-feature
and boom, you're paying for storage. Delete branches right after merging or you'll get hit with a surprise bill.
Storage Will Bankrupt You
Storage will kill your budget fast. We're paying $150/month for about 100GB of data, which feels ridiculous:
- Implement data archiving strategies using GitHub Actions
- Use query insights to identify unused tables and columns
- Implement horizontal sharding before vertical scaling
- Regular schema optimization to remove unused indexes
Migration and Deployment Optimization
Zero-downtime migrations are PlanetScale's killer feature, but they consume resources during deployment:
- Schedule large migrations during low-traffic periods
- Use deploy requests to batch multiple schema changes
- Monitor replication lag during migrations
- Clean up development branches regularly - they consume storage too
Development Branch Management
Development branches are often overlooked cost centers:
- Delete unused development branches immediately after merging
- Use branch promotion instead of creating new production branches
- Limit development branch data size - they don't need full production datasets
- Implement automated branch cleanup in CI/CD pipelines
Cross-Platform Optimization Principles
Regardless of your platform choice, these universal principles apply:
Monitoring and Alerting
Set up cost monitoring before you need it, not after your first surprise bill. Each platform offers different tools:
- Supabase: Built-in usage dashboard with real-time updates
- Firebase: Google Cloud Billing alerts with budget thresholds
- PlanetScale: Third-party tools like Vantage for detailed analytics
Development Environment Optimization
Development costs often exceed production costs due to poor cleanup habits:
- Use local development databases when possible
- Implement automated resource cleanup in CI/CD pipelines
- Share development environments across team members
- Use production data samples, not full datasets, for development
Architecture-Level Cost Optimization
Sometimes the biggest savings come from architectural changes:
- Implement proper caching layers to reduce database queries
- Use read replicas for analytics workloads when available
- Consider hybrid approaches - use different platforms for different use cases
- Evaluate serverless vs. always-on based on your traffic patterns
Each platform has its own way of fucking you over cost-wise. Supabase at least tells you upfront what you're paying for and actually stops charging when you hit your limit. Firebase can be cheap if you know exactly what you're doing, but you'll spend weeks figuring out why your bill is so high and questioning your life choices. PlanetScale costs a lot but it's predictable and doesn't break in weird ways.
The key is understanding how each platform's billing works so you can optimize for it instead of getting surprised by weird charges that make you want to rage-quit development.