Firebase
Google's app development platform
Complete backend platform from Google with realtime database, authentication, hosting, and cloud functions. The original BaaS that pioneered the category.
Firebase is Google's Backend-as-a-Service platform that pioneered the category. It provides a NoSQL realtime database, authentication, hosting, storage, cloud functions, and more - everything you need to build a mobile or web app without managing servers.
Why Use Firebase
Realtime by Default: Firebase's Realtime Database syncs data across all clients in milliseconds. When data changes, every connected client updates instantly. Perfect for chat apps, collaborative tools, or live dashboards.
Google Infrastructure: Built on Google Cloud Platform, Firebase offers world-class reliability, security, and performance. Your app benefits from Google's global network and proven infrastructure.
Mobile-First Design: Firebase was built for mobile apps first, then expanded to web. The SDKs for iOS, Android, and web are mature, well-documented, and handle offline scenarios gracefully.
Generous Free Tier: The Spark (free) plan includes 1GB storage, 10GB/month bandwidth, 50K reads and 20K writes per day. Enough to validate your idea and get your first users.
Key Features
- Realtime Database - NoSQL database that syncs in realtime
- Firestore - Document database with better querying than Realtime DB
- Authentication - Email, social providers, phone, anonymous auth
- Cloud Functions - Serverless backend code triggered by events
- Hosting - Static site hosting with CDN and SSL
- Storage - File uploads with CDN delivery
- Cloud Messaging - Push notifications for mobile
- Analytics - Built-in app analytics
- Crashlytics - Crash reporting for mobile apps
- Remote Config - Change app behavior without deploying
Pricing for Solo Builders
Spark (Free):
- 1 GB Firestore storage
- 50K reads, 20K writes, 20K deletes per day
- 10 GB hosting bandwidth
- 125K function invocations per month
- Perfect for MVPs and side projects
Blaze (Pay as you go):
- Same free tier, then pay for usage
- Firestore: $0.18 per 100K reads
- Functions: $0.40 per million invocations
- Storage: $0.026 per GB
- Only pay for what you use
Most solo projects stay free or pay $5-20/month once they get traction.
Perfect For
- Mobile apps (iOS, Android, React Native)
- Realtime applications (chat, collaboration)
- Apps that need offline support
- Projects that want to ship fast
- Teams already in Google Cloud ecosystem
- Apps that benefit from Google's ML Kit, Vision API
Firestore vs Realtime Database
Firebase offers two database options:
Realtime Database:
- Simpler data model (JSON tree)
- Lower latency for realtime sync
- Pricing is by bandwidth
- Good for simple apps
Firestore:
- Better querying (compound queries, filtering)
- Better scaling for large datasets
- Pricing is by operations
- Recommended for new projects
Most new projects should use Firestore.
Code Example
import { initializeApp } from 'firebase/app';
import { getFirestore, collection, addDoc, onSnapshot } from 'firebase/firestore';
// Initialize Firebase
const app = initializeApp({
apiKey: "YOUR_API_KEY",
projectId: "your-project-id",
});
const db = getFirestore(app);
// Add data
await addDoc(collection(db, 'todos'), {
title: 'Build my app',
done: false,
createdAt: new Date()
});
// Listen to realtime updates
onSnapshot(collection(db, 'todos'), (snapshot) => {
snapshot.docs.forEach(doc => {
console.log(doc.id, doc.data());
});
});
Firebase vs Supabase
Choose Firebase if you:
- Need realtime sync with offline support
- Building a mobile app (better mobile SDKs)
- Want Google ecosystem integration
- Need push notifications and analytics built-in
- Prefer NoSQL/document databases
Choose Supabase if you:
- Want SQL/Postgres (better for complex queries)
- Need row-level security policies
- Prefer open source solutions
- Want a simpler pricing model
- Need realtime but also love SQL
Both are excellent. Firebase is more mature with better mobile support. Supabase has a better database (Postgres) and simpler pricing.
Integration With Other Tools
Firebase works with:
- React, Vue, Angular - Official web SDKs
- React Native, Flutter - Great mobile SDKs
- Stripe - Via Firebase Extensions
- Algolia - Search via Extensions
- SendGrid - Email via Extensions
When to Choose Something Else
Consider alternatives if you:
- Need SQL and complex queries (use Supabase or PlanetScale)
- Want to avoid vendor lock-in (use open source like Supabase)
- Need full control over infrastructure (use Railway + your own DB)
- Building mainly for web (Supabase might be simpler)
Common Patterns
Simple Todo App:
// Create
await addDoc(collection(db, 'todos'), { title, done: false });
// Read with realtime updates
onSnapshot(collection(db, 'todos'), (snapshot) => {
const todos = snapshot.docs.map(doc => ({ id: doc.id, ...doc.data() }));
setTodos(todos);
});
// Update
await updateDoc(doc(db, 'todos', todoId), { done: true });
// Delete
await deleteDoc(doc(db, 'todos', todoId));
Security Rules:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
// Only authenticated users can read/write
match /todos/{todoId} {
allow read, write: if request.auth != null;
}
}
}
Tips for Solo Builders
- Start with Firestore (not Realtime Database) for new projects
- Use Firebase Auth - it handles OAuth flows perfectly
- Set up security rules from day one
- Use Firebase Extensions for common integrations
- Monitor usage in console to avoid surprise bills
- Use Firebase Emulators for local development
- Enable offline persistence for mobile apps
The Verdict
Firebase is the most mature BaaS platform. It's been around since 2011 (acquired by Google in 2014) and powers millions of apps. The tooling is excellent, the docs are comprehensive, and it just works.
The main downsides are vendor lock-in (Firebase-specific APIs) and NoSQL limitations for complex queries. But if you're building a mobile app or need realtime sync with offline support, Firebase is hard to beat.
For web-only projects with complex data models, Supabase might be a better fit. But Firebase remains the gold standard for mobile apps and realtime applications.