all posts

The best Firebase alternatives in 2026

Ajay Kumar··9 min read

Firebase is a bundle: a NoSQL document database, authentication, file storage, cloud functions, hosting, and a realtime sync layer that made it famous. The reason it's hard to leave isn't any one of those — each has an obvious replacement — it's that you're probably using four of them and they're wired together by SDKs that assume each other.

So the useful way to plan a move is piece by piece. I build PandaStack, which covers two of the six pieces and none of the rest; I'll be explicit about that rather than pretending otherwise.

Why people leave

1. The bill, suddenly

Firestore bills per document read, and the pricing model makes some perfectly reasonable application patterns extremely expensive — a listener on a collection that changes often, a screen that reads a hundred documents to render a list, a poorly-shaped denormalisation. Costs are fine and then abruptly are not, usually right after a growth spurt. This is the single most common reason people start looking.

2. Query limits

Firestore is not a relational database and doesn't pretend to be. No joins, restricted compound queries, composite indexes you must declare in advance, and aggregations that are awkward. Applications that start simple grow reporting requirements, and the moment someone asks for 'revenue by region by month', you're either exporting to BigQuery or you're fighting.

3. Lock-in and portability

The client SDKs are the lock-in, more than the data. Auth, database access, and storage are all reached through Firebase-specific libraries embedded across your app, so migrating means touching every call site rather than swapping a connection string. Worth knowing before you start estimating.

4. Cloud Functions limits

Cold starts, execution ceilings, and a runtime that's fine for glue but poor for real work — anything long-running, memory-hungry, or dependent on native binaries. Teams commonly keep the rest of Firebase and move just this piece.

Replacing it, piece by piece

If you want another bundle: Supabase or Appwrite

Supabase is the closest cultural equivalent — Postgres instead of Firestore, plus auth, storage, realtime, and edge functions, with an open-source core and self-hosting available. The database being relational is the real difference: joins, transactions, and proper aggregation, at the cost of the schemaless flexibility Firestore gives you early on. Appwrite is the other serious all-in-one, self-hostable, with a similar surface area and a different flavour of SDK. Either keeps your architecture recognisable.

Auth: Clerk, Auth0, WorkOS, Supabase Auth

The easiest piece to replace and often the first one people move, because Firebase Auth's UI and enterprise SSO story lag the specialists. Clerk for a modern developer experience, Auth0 for breadth and maturity, WorkOS if enterprise SSO is the requirement, Supabase Auth if you're moving the whole bundle there.

Database: Postgres, or a document database if you meant it

Most Firestore data models are relational data stored in documents because that's what was available. If that describes you, moving to Postgres will simplify the application substantially. If you genuinely have document-shaped data with variable schema, MongoDB Atlas or DynamoDB are honest replacements — don't force a document model into tables out of fashion.

Storage: S3, R2, or your provider's equivalent

The most commoditised piece. Cloudflare R2 is notable for having no egress fees, which matters if you serve a lot of user-uploaded media. Everything else is roughly interchangeable.

Functions and backend compute

If Cloud Functions were the constraint, you want a runtime without the constraint. That's the part my product covers: PandaStack runs functions and scheduled jobs inside Firecracker microVMs, so there is no CPU-time ceiling, native dependencies work, and each invocation is hardware-isolated rather than sharing a runtime. It also hosts long-running apps from a git repo and provides managed Postgres per microVM, which together cover 'the backend and the database'. It does not do auth, client SDKs, file storage, or realtime sync — for those you'd pair it with the specialists above. If you want one vendor for all six pieces, Supabase or Appwrite is the answer, not this.

# Replacing a Cloud Function that outgrew its limits:
# any dependency, no execution ceiling, isolated per invocation.
pandastack function deploy ./process_upload.py \
  --name process-upload \
  --runtime python

# And the scheduled jobs that were Cloud Scheduler + Pub/Sub:
pandastack schedule create \
  --name nightly-aggregate \
  --function-id <id> \
  --cron "0 2 * * *"
You don't have to move all of it. A very common and sensible end state is Firebase Auth kept because it works, Firestore replaced with Postgres because the queries hurt, and Cloud Functions replaced because they were the bottleneck. Partial migrations are underrated.

How to migrate without breaking the app

  1. Put a data-access layer between your app and Firebase first, if you don't have one. Migrating is much easier when the SDK calls live in twenty files rather than two hundred.
  2. Model the relational schema before exporting anything. A Firestore export dumped straight into JSONB columns is not a migration, it's the same problem in a new database.
  3. Move auth first if you're moving it. It's the most self-contained piece and forces you to confront user-identity mapping early, which is where migrations quietly break.
  4. Dual-write during the transition for the database. Write to both, read from the old one, then flip reads once you've diffed a sample and they agree.
  5. Budget for the client SDK rewrite honestly. It's usually the largest single chunk of work and the easiest to underestimate.
  6. Keep the Firebase project alive and readable for weeks after cutover. Deleting it is the last step, not the celebration.

Short version

Want the same bundle with a relational database: Supabase. Want it self-hosted: Appwrite or Supabase self-hosted. Only auth hurts: Clerk or WorkOS. Only the queries hurt: Postgres, and keep the rest. Only the functions hurt: a runtime with no ceilings — a container platform, or microVM functions like PandaStack's. And if none of the four reasons is really yours, Firebase remains a very good product; the fastest migration is the one you skip.

Frequently asked questions

What is the best open-source Firebase alternative?

Supabase and Appwrite are the two serious contenders, and both can be self-hosted. Supabase is built around Postgres and pairs it with auth, storage, realtime subscriptions, and edge functions — the relational database is the meaningful difference from Firestore, giving you joins, transactions, and real aggregation in exchange for schema discipline. Appwrite offers a comparable surface area with its own database layer and SDK style, and is often preferred by teams who want a single self-hosted container to run. Both give you an exit path Firebase does not, though self-hosting either means you now operate a database, an auth service, and a storage layer, which is a real ongoing cost.

Why did my Firebase bill suddenly increase?

Almost always Firestore document reads. Firestore bills per document read, and several ordinary application patterns multiply that count quickly: a realtime listener attached to a collection that changes frequently, a list screen that reads every document to render a summary, a denormalisation that fans a single logical update into many reads, or a client that re-subscribes on every navigation. Costs stay modest and then step up sharply after a growth spurt or a UI change that nobody thought of as a database change. Check the usage breakdown by operation before assuming it is storage or bandwidth — it usually is not.

Should I move from Firestore to Postgres?

If your data is really relational, yes, and the sooner the better. A large share of Firestore schemas are relational models stored as documents because that was the available tool, and they show it: manual denormalisation, application-side joins, aggregate counters maintained by hand, and reporting queries that are impossible without an export to a warehouse. Postgres removes all of that. If, on the other hand, your documents genuinely have variable structure and you rarely query across them, a document database remains the right model and MongoDB or DynamoDB are the honest replacements. Choose on the data's actual shape rather than on which database is currently fashionable.

How hard is it to migrate off Firebase?

The data is the easy part; the client SDKs are the hard part. Exporting Firestore and loading it into another database is a scripting exercise, and you should design the destination schema properly rather than dumping documents into JSON columns. The expensive work is that Firebase's auth, database, and storage are all reached through Firebase-specific client libraries scattered across your application, so migrating means touching every call site rather than changing a connection string. Teams that already route Firebase access through their own thin data layer migrate in weeks; teams that call the SDK directly from components take considerably longer. Adding that layer first is usually worth it even before you decide to move.

What can replace Firebase Cloud Functions for long-running work?

Anything that runs a real process rather than a constrained function runtime. If the problem is the execution ceiling, memory limits, cold starts, or an inability to use native binaries, you want a container platform, a VM, or a microVM-backed function runtime where the invocation is not sharing a restricted sandbox. The practical options are a container on Cloud Run or a similar service, a long-running worker on a PaaS consuming from a queue, or a functions product built on VM-level isolation. Keep the rest of Firebase if it is working — replacing just the compute layer is a common, low-risk migration that solves the specific pain without a full rewrite.

Keep reading

Run code in a microVM in one API call.

49ms p50 cold start. Fork, snapshot, and scale to zero.

Start free
Written by Ajay Kumar, Founder, PandaStack.