# Firebase alternative on Postgres

> Scribase is a Postgres backend with auth, storage, realtime and functions. The importer moves Firestore, Auth and Cloud Storage data, verifying every table.

Source: https://scribase.com/firebase-alternative

Keep the things Firebase does well (sign-in, file storage, live updates, mobile SDKs) and gain SQL, joins, row level security and a database you can branch and export. The importer keeps every password working.

## How Firebase concepts map to Scribase

| Firebase | Scribase |
| --- | --- |
| Firestore collections | Postgres tables; imported documents land as rows with a jsonb data column you can query with SQL |
| Security rules | Row level security policies written in SQL (imported tables start locked: RLS on, no policies) |
| Firebase Auth | Auth with email and password, magic links, OAuth providers, anonymous users, TOTP and passkeys |
| Cloud Storage | Storage buckets with RLS, signed URLs and image transforms |
| onSnapshot listeners | Realtime postgres_changes, broadcast and presence |
| Cloud Functions | Edge functions (Deno), plus pg_cron for schedules and pgmq for queues |
| Firebase SDKs | supabase-js, Swift, Kotlin, Flutter and Python clients |

## What the importer brings over

- Every collection group as a table, subcollections as parent__child tables, with document ids and paths kept so references resolve.
- Timestamps, references, geo points, bytes, maps and arrays converted to JSON.
- Firebase Auth users with email, phone, verification state, custom claims and linked identities.
- Firebase modified-scrypt password hashes with your project hash parameters, verified natively at sign-in, so nobody resets a password.
- Cloud Storage objects with a SHA-256 check on each file, then a verification report per table.

## What you rewrite by hand

- Security rules become SQL policies. Nothing is exposed until you write them.
- Cloud Functions become edge functions.
- Firebase does not export multi-factor enrollments; those users enroll again.

## How you move it (no one-command CLI yet)

Unlike Supabase, Neon, Clerk and Resend, Firebase has no scribase-migrate source — say that plainly instead of inventing a one-liner that does not exist. Moving a Firebase project is three real steps using the scribase package's own importers module and the Scribase SDK, not a single command.

1. **Export Firestore and Cloud Storage** — Reads Firestore and Cloud Storage through Google REST APIs with a service account. No Firebase SDK needed.

```ts
import { writeFirebaseExport } from 'scribase/importers';

await writeFirebaseExport({
  projectId: 'my-app',
  serviceAccount: JSON.parse(process.env.GOOGLE_SERVICE_ACCOUNT!),
  directory: './firebase-my-app',
  authExportPath: './auth.json',
  buckets: ['my-app.appspot.com'],
});
```

2. **Export Auth with the Firebase CLI** — Password hashes are only available through the Firebase CLI, not the REST export above.

```sh
firebase auth:export auth.json --format=JSON --project my-app
```

3. **Run the import and read the report** — createFrom() plans the move first; drop verifyLogin to skip the sign-in proof.

```ts
await scribase.imports.createFrom({
  source: 'firebase',
  sourceFirebaseProjectId: 'my-app',
  sourceExportDir: 'firebase-my-app',
  sourceHashConfig: { base64_signer_key: '…', base64_salt_separator: 'Bw==', rounds: 8, mem_cost: 14 },
  destination: { organizationId: 'acme', projectId: 'app', environmentId: 'production' },
  verifyLogin: { email: 'you@yourapp.com', password: process.env.TEST_PASSWORD },
});
```

## When to stay on Firebase

Firebase does some things Scribase does not try to match:

- You need offline-first mobile apps: Firestore's on-device cache and sync-on-reconnect is built in. Postgres clients have no equivalent; a mobile app usually adds its own local store (SQLite, a query cache) for the screens that must work offline.
- You need a long list of compliance certifications today: Firebase states all its services pass ISO 27001 and SOC 1, SOC 2 and SOC 3 evaluation, with some services also ISO 27017/27018. Scribase has none of these yet (see /security). Neither platform publishes a HIPAA BAA as of this check.
- You want Google-scale infrastructure and global reach by default: most Firebase services run on Google's global Cloud Platform infrastructure. Scribase is one Oracle VM in Frankfurt.
- You are already deep in the Firebase/GCP ecosystem (Cloud Functions, Analytics, Remote Config, Crashlytics) and do not want to rebuild those integrations.

## Sources

- [Firebase: Security, Privacy, and Compliance](https://firebase.google.com/support/privacy/)

## FAQ

**Do I lose offline support?**

Firestore has built-in offline caching; Postgres clients do not. Mobile apps usually add a local store (SQLite or a query cache) for the screens that must work offline.

**Will my documents still be documents?**

Each document becomes a row whose fields sit in a jsonb column, so data->>'email' works right away. Move the fields you filter on into real columns with ordinary migrations when you are ready.

**How much does it cost?**

Per project, per month: $5 on Hobby or $25 on Pro. Reads and writes are not metered per operation.

## Related

- [Backend as a service compared](https://scribase.com/backend-as-a-service)
- [Convex alternative](https://scribase.com/convex-alternative)
- [PocketBase alternative](https://scribase.com/pocketbase-alternative)
- [Migrate from Firebase](https://scribase.com/migrate/firebase)
- [Firebase Realtime Database limits](https://scribase.com/firebase-realtime-database-limits)
- [Firebase Auth vs Supabase Auth](https://scribase.com/firebase-auth-vs-supabase-auth)
- [Firebase Blaze plan pricing](https://scribase.com/firebase-blaze-plan-pricing)
- [Back4app alternative](https://scribase.com/back4app-alternative)
- [Supabase alternative](https://scribase.com/supabase-alternative)
- [InstantDB alternative](https://scribase.com/instantdb-alternative)
- [Postgres extensions](https://scribase.com/extensions)
- [Pricing](https://scribase.com/pricing)