| Database | PostgreSQL — full relational database with SQL, joins, indexes, views, triggers, and extensions like PostGIS. | Firestore — NoSQL document database with collections, subcollections, and limited querying capabilities. |
| Auth | Built-in auth with email, OAuth, magic links, and phone. Row Level Security for authorization. | Firebase Auth with email, OAuth, phone, anonymous auth. Security rules for Firestore and Storage. |
| Real-time | Postgres CDC-based real-time via websockets. Subscribe to table or row-level changes. | Native real-time listeners on Firestore documents and collections. Built into every client SDK. |
| Functions | Edge Functions (Deno-based) deployed globally. Also supports database functions and triggers in SQL. | Cloud Functions (Node.js, Python) running on Google Cloud. Tight integration with all Firebase services. |
| Pricing | Usage-based with generous free tier. Predictable pricing based on database size, bandwidth, and functions. | Pay-as-you-go with per-read/write pricing on Firestore. Costs can spike unexpectedly at scale. |
| Vendor Lock-in | Low — standard PostgreSQL. Export data with pg_dump, migrate to any Postgres host, or self-host entirely. | High — proprietary Firestore data model. Migration requires rewriting queries and data access patterns. |
| Scalability | Scales well with Postgres optimizations. Connection pooling via Supavisor. Can scale reads with read replicas. | Scales automatically and massively. Google infrastructure handles millions of concurrent connections effortlessly. |
| Developer Experience | Dashboard with SQL editor, auto-generated REST/GraphQL APIs, TypeScript types generation, local dev with CLI. | Excellent emulator suite for local dev. Firebase console with real-time data explorer and analytics dashboards. |