Migrate from Firebase
Firebase gets you live fast, but a Cloudflare-native move is a real redesign: Firestore's denormalized documents become a relational D1 schema, Auth becomes passwordless email-code, Cloud Functions become Workers, and FCM has no native equivalent. The document→relational step is the biggest task — this page names it instead of hiding it.
pnpm create microservices-app@latest my-app --template saas-starter-sveltekit Local-first · no login · Node ≥ 20 · driven by the firebase-to-microservices agent skill
Concept mapping
| Firebase | microservices.sh / Cloudflare | Note |
|---|---|---|
| Firestore collections / documents | D1 tables via Drizzle | Denormalized docs → relational schema — the biggest task |
| Realtime Database (JSON tree) | D1, or Durable Objects for live state | Pick per access pattern |
| Security Rules | Permission checks at the Worker boundary | No DB-enforced rules in D1 |
| Firebase Auth (password, phone, OAuth) | Passwordless email-code auth | Credentials do not carry over |
| Cloud Storage | R2 buckets | |
| Cloud Functions (triggers, HTTPS) | Module events/hooks + Worker routes | |
| FCM push | External push provider via a Worker | No native equivalent |
| onSnapshot listeners | Durable Objects + WebSocket | No drop-in — rebuilt |
The migration
Enumerate collections, subcollections, document shapes, denormalized data, Security Rules, auth providers, Cloud Functions, scheduled jobs, FCM usage, and document counts.
Use a customer-backed template when documents model people/accounts; add email and payment as needed.
Promote collections to tables, subcollections to child tables with FKs, embedded arrays to join tables; convert Timestamp→epoch, reference→FK, map→JSON text.
Export with gcloud firestore export, flatten maps and resolve references to FKs, load to local D1 first, verify counts per collection before remote import.
Import Firebase email + uid into the customer table; users re-verify by email code; map Security Rules to explicit Worker checks.
What doesn't port 1:1
pnpm create microservices-app@latest my-app --template saas-starter-sveltekit Lands on these modules
Still deciding? Read the evaluation-intent comparison: microservices.sh vs Supabase & BaaS →