Skip to content

Migration playbook: Firebase Firestore → Supabase and PostgreSQL

Firebase Firestore to Supabase PostgreSQL migration

Move from Firestore documents to relational PostgreSQL on Supabase for SQL joins, transactions and pricing that doesn't depend on document reads.

Migration drivers

Why teams make this move

Driver 01

Unpredictable read and write bills

Costs that spike when a client query reads far more documents than expected.

Driver 02

No joins

Duplicating data across collections because Firestore can't join.

Driver 03

Vendor lock-in

Proprietary SDKs and security rules that don't move to another platform.

Execution sequence

How the migration runs

Each phase ends with a check you can verify — data parity, error rates, latency — and the rollback path is agreed before any traffic moves.

  1. 01Phase

    Documents to a relational schema

    Normalizing nested Firestore collections into PostgreSQL tables with foreign keys.

  2. 02Phase

    Export and load

    Exporting Firestore data and loading it into PostgreSQL with transformation scripts.

  3. 03Phase

    Auth and storage

    Migrating Firebase Auth users, with password hashes where they can be verified, and files to S3-compatible storage.

  4. 04Phase

    Row Level Security and SDK cutover

    Replacing Firebase Security Rules with PostgreSQL Row Level Security policies.

Risk prevention

Pitfalls that derail this migration

Risk 01

Leftover denormalized fields

Carrying stale duplicate fields from NoSQL documents into normalized tables.

Risk 02

Password hash verification

Misconfiguring verification of Firebase's modified scrypt hashes, which locks users out.

Risk 03

Unindexed foreign keys

Forgetting to index foreign key columns, which makes joins fall back to sequential scans.

Before and after

What we measure

We take a baseline before any change and report the same numbers after cutover, from your own tools. They are the evidence of whether the migration worked — not figures promised in advance.

Monthly cost
Firebase bill vs Supabase plan for the same usage
Row parity
Documents exported vs rows loaded, per collection
Login success
Sign-in success rate after the auth cutover

Questions

Frequently asked migration questions

Usually. Firebase uses a modified scrypt algorithm, and the user export includes the hashes and the parameters needed to verify them. We test sign-in on a sample of migrated users first; anyone whose hash can't be verified gets a passwordless or reset flow.

Yes. Supabase Realtime broadcasts database changes over WebSockets, filtered by Row Level Security.

Rehearse the cutover before the real one

Tell us about your data volume, traffic and timeline. An engineer will reply within one business day to set up a call about the migration plan and its rollback path.