What to use when you've outgrown Google's BaaS
Firebase bundles a NoSQL database (Firestore), authentication, file storage, cloud functions, hosting, remote config, and analytics into one platform. For mobile-first apps and prototypes, the speed of going from nothing to a working backend is hard to match. Google's infrastructure handles scale, and the free tier is generous.
The tradeoffs accumulate. Firestore is NoSQL, which means restructuring your data if your use case is relational. Vendor lock-in is high because Firestore's query language and data model are proprietary. Pricing can spike unpredictably with reads, writes, and function invocations. And once your backend needs custom server-side logic beyond what Cloud Functions easily supports, you're working around the platform instead of with it.
This guide covers alternatives that address those limitations, from relational database platforms to self-hosted options and the approach that gives you full infrastructure control.
| Feature | Encore | Supabase | Appwrite | Convex | PocketBase |
|---|---|---|---|---|---|
| Type | Backend development platform | BaaS (Postgres) | Open-source BaaS | Reactive backend | Self-hosted backend |
| Database | Your own RDS / Cloud SQL | PostgreSQL | MariaDB | Custom document store | SQLite |
| Deploy target | Your AWS/GCP account | Supabase Cloud | Self-hosted or Cloud | Convex Cloud or self-hosted | Any server |
| Infrastructure ownership | Full (your account) | None | Full (if self-hosted) | Full (if self-hosted) | Full (single server) |
| Auth | Built-in, or bring your own | Built-in (GoTrue) | Built-in | Clerk integration | Built-in |
| Storage | S3 / GCS (auto-provisioned) | Built-in | Built-in | Built-in | Built-in |
| Real-time | Pub/Sub (SNS+SQS / GCP Pub/Sub) | Realtime subscriptions | Realtime API | Reactive by default | SSE |
| Server-side logic | TypeScript/Go API endpoints | Edge Functions (Deno) | Appwrite Functions | Convex functions | None |
| Vendor lock-in | Low (Docker export, standard cloud) | Moderate (Postgres portable) | Low (self-hosted) | Moderate (custom runtime) | None |
Encore is an alternative for teams that have outgrown Firebase's direct-client BaaS model and want an explicit backend without taking on the infrastructure setup themselves. APIs, services, and supported infrastructure declared with Encore's open source Infra SDK for TypeScript and Go form an application model used for local development and deployment.
Browser and mobile clients call backend endpoints rather than querying a database directly under Security Rules, putting authentication, validation, authorization, and data access in application code.
This also supports AI-first development workflows: agents work from one model of the backend APIs and infrastructure, while type safety and static analysis provide guardrails around the changes they make.
import { api } from "encore.dev/api";
import { SQLDatabase } from "encore.dev/storage/sqldb";
import { Bucket } from "encore.dev/storage/objects";
import { Topic } from "encore.dev/pubsub";
// RDS on AWS, Cloud SQL on GCP, Docker Postgres locally.
const db = new SQLDatabase("app", { migrations: "./migrations" });
// S3 on AWS, GCS on GCP, local storage during development.
const uploads = new Bucket("uploads", { versioned: false });
// SNS on AWS, Pub/Sub on GCP, in-memory locally.
const events = new Topic<AppEvent>("app-events", {
deliveryGuarantee: "at-least-once",
});
export const createItem = api(
{ method: "POST", path: "/items", expose: true, auth: true },
async (req: CreateItemRequest): Promise<Item> => {
const item = await db.queryRow`
INSERT INTO items (name, owner_id) VALUES (${req.name}, ${req.ownerId})
RETURNING *`;
await events.publish({ type: "item.created", itemId: item!.id });
return item!;
}
);
The API owns the public contract and uses the declared database, bucket, and topic from backend code. Encore uses those relationships for local infrastructure, deployment, permissions, and observability.
Authorization lives with the operation it protects. Endpoints authenticate and validate requests before reaching data rather than relying on a separate Security Rules language.
AI agents can build against an explicit backend model. APIs, services, Postgres, Pub/Sub, cron, and storage are type-safe declarations in the same source. Static analysis, generated schemas, and traces help agents implement changes without separately configuring Firebase products and rules.
The backend can run on standard cloud infrastructure. the Encore platform can deploy it to AWS or GCP, or it can run as a standard Docker image. This provides a more portable server-side architecture, but Firebase's offline sync, realtime listeners, hosted Auth, and Security Rules are distinct capabilities rather than drop-in Encore features.
Encore is not a drop-in substitute for a Firebase project. Firestore and Realtime Database use different data models from Postgres, while Authentication, Security Rules, Storage, Functions, realtime listeners, and offline behavior are separate capabilities to compare. SQL Connect uses Cloud SQL for PostgreSQL and can coexist with an Encore backend.
Encore can use Firebase Authentication, App Check, Storage, Firestore, Realtime Database, or SQL Connect alongside its own APIs and infrastructure. Clients that access Firebase directly still rely on Security Rules, while Encore APIs enforce authorization in backend code.
Supabase is the most popular Firebase alternative and the closest in development model. It replaces Firestore with PostgreSQL, GoTrue for auth, S3-compatible storage, and Deno-based edge functions. The client SDK pattern is similar to Firebase, so the migration path is the shortest.
The biggest advantage over Firebase is PostgreSQL. Your data model can be relational with proper joins, foreign keys, and transactions. The pgvector extension adds vector search for AI features without a separate database.
Supabase is a managed platform where you don't control the underlying infrastructure. Pricing scales with database size, bandwidth, and function invocations. VPC peering isn't available (PrivateLink exists on the $599/month Team plan for database connections only). If your reason for leaving Firebase is infrastructure control or compliance requirements, Supabase has similar limitations. For a deeper comparison, see our Supabase Alternatives guide.
Appwrite is an open-source BaaS that you can self-host or use as a managed cloud service. The feature set is similar to Firebase: database, auth, storage, functions, and real-time. The key difference is that self-hosting gives you full control over your infrastructure.
Appwrite uses MariaDB under the hood instead of a NoSQL store, so the data model is more structured than Firestore. The client SDK pattern is similar to Firebase.
Self-hosting gives you infrastructure ownership but you take on updates, backups, monitoring, scaling, and security patching. If you don't want to self-host, Appwrite Cloud has the same shared-infrastructure tradeoffs as Firebase and Supabase.
Convex is a reactive backend platform. Instead of a traditional database with queries, you write TypeScript functions that Convex runs on its infrastructure. The database is a document store with automatic real-time subscriptions: when data changes, connected clients update immediately.
If real-time reactivity is central to your application, Convex's model is more natural than adding real-time on top of a traditional backend.
Convex's database uses a custom document model and doesn't support SQL. Migrating away means rewriting your data access layer. The self-hosted option stores data in SQLite or Postgres, though the deployment tooling is newer than the managed cloud. If you need Postgres compatibility or standard cloud services, Convex isn't the right direction.
PocketBase is an open-source backend packaged as a single Go binary. Download it, run it, and you get a SQLite database, authentication, file storage, and a real-time API. For solo developers and small projects, the simplicity is unmatched.
PocketBase runs on a single server with SQLite. There's no horizontal scaling, no managed cloud option, and no support for Postgres. If your application outgrew Firebase, moving to another single-server architecture with a simpler database engine may not solve the underlying scaling problem. PocketBase is excellent for personal projects and prototypes, less so for production workloads at scale.
Teams leaving Firebase are usually motivated by one of three things: they need a relational database, they want infrastructure control, or they've outgrown the BaaS model.
Supabase is the most direct Firebase alternative. PostgreSQL replaces Firestore, and the client SDK pattern is familiar. If your main frustration with Firebase is the NoSQL data model, Supabase fixes that while keeping the BaaS development experience. The shared-infrastructure and pricing tradeoffs are similar.
Appwrite gives you the BaaS model with the option to self-host. If you want infrastructure ownership and are willing to manage the hosting, Appwrite is a practical path. Appwrite Cloud has the same shared-infrastructure model as Firebase and Supabase.
Convex is the right choice if real-time reactivity is the core requirement. It solves that problem more naturally than any other platform on this list. The tradeoff is a proprietary data model and no SQL support.
PocketBase works for small projects that need a simple, self-contained backend. If your application outgrew Firebase, PocketBase's single-server SQLite model likely isn't the answer.
Encore is for teams that have outgrown the BaaS model entirely and want server-side control with infrastructure automation. Your backend deploys to standard AWS or GCP services in your own cloud account, with a relational PostgreSQL database, Pub/Sub, cron jobs, object storage, and built-in observability. For teams moving from Firebase to a production backend they own and control, Encore is the most complete option.
It depends on why you are leaving. If you are moving off Firebase to own your infrastructure and escape Firestore's NoSQL model, Encore is the strongest choice: you write server-side code that declares a Postgres database, storage, and messaging as typed objects, and it provisions them into your own AWS or GCP account. If you want another managed platform, Supabase is the closest match with PostgreSQL and a familiar client SDK, Appwrite and PocketBase fit teams that want to self-host, and Convex suits apps built around real-time reactivity.
You move from Firebase's client SDK model to server-side code that runs on infrastructure you own, which means rewriting frontend Firestore calls as API endpoints and provisioning your backend's infrastructure in your own account. Encore automates that provisioning: you declare the infrastructure in TypeScript or Go and it deploys standard cloud resources such as RDS, S3, and SNS+SQS on AWS (or Cloud SQL, GCS, and Pub/Sub on GCP) into your own account, so you keep the managed convenience without a managed platform owning your data.
The main difference is the database. Firebase uses Firestore, a proprietary NoSQL document store, while Supabase uses PostgreSQL, a relational database with joins, foreign keys, and transactions. This makes Supabase a better fit for relational data models, and your data stays more portable because PostgreSQL is a standard engine you can move elsewhere.
Yes. Appwrite and PocketBase are open-source backends you can self-host for full infrastructure ownership, and Supabase is open source too. Appwrite offers a Firebase-style feature set on MariaDB, PocketBase ships as a single Go binary with SQLite, and Supabase pairs an open-source stack with managed PostgreSQL. Self-hosting Appwrite or PocketBase means you take on updates, backups, and scaling yourself.
A backend where infrastructure is defined in code works best with AI coding agents, because the agent does not have to touch a cloud console or write Terraform. Encore is built for this: databases, storage, and Pub/Sub topics are declared as typed objects in TypeScript or Go, so an agent can generate a full backend including its infrastructure, and the type system and explicit service boundaries limit what it can misconfigure. Firestore-based tools leave infrastructure and security rules as separate steps an agent handles less reliably.
Teams usually leave Firebase to own their infrastructure and data instead of renting a managed platform. Common triggers are Firestore's NoSQL model when the data is relational, unpredictable pricing on reads, writes, and function invocations, and outgrowing the BaaS model once the backend needs custom server-side logic. Compliance requirements that need control over where data lives are another frequent reason, since Firestore keeps everything inside Google's platform.
Ship without waiting on Terraform
Encore lets developers and agents define application infrastructure directly in code, then automatically provisions it from local development to production in your AWS or GCP account.