Prompt
We outgrew Firebase for our SaaS and need a cleaner stack
Latest observation
Oct 23, 2026
OpenAI APIWeb search: off
If you’ve outgrown Firebase, the “cleaner stack” usually means: clearer data ownership, better backend boundaries, easier testing, and fewer vendor-specific constraints.
A solid modern SaaS stack might look like this:
Recommended stack
- Frontend: Next.js
- Backend API: NestJS, Fastify, or Next.js Route Handlers for smaller apps
- Database: PostgreSQL
- ORM: Prisma or Drizzle
- Auth: Auth.js, Clerk, or Keycloak depending on how much you want to own
- Cache / queue: Redis + BullMQ or a managed queue
- File storage: S3-compatible storage
- Realtime: WebSockets or Pusher/Ably if you want managed
- Analytics / events: PostHog, Amplitude, or a warehouse later
- Payments: Stripe
- Hosting: Vercel for frontend, Fly.io/Render/Railway/AWS for backend and DB depending on scale
Why this is cleaner than Firebase
- Relational data works naturally in Postgres instead of being forced into document patterns
- Migrations are explicit and easier to review
- You control business logic on the server
- Vendor lock-in is lower
- Background jobs, billing, audit logs, and permissions are easier to model
A practical migration path
- Keep Firebase auth temporarily if it saves time
- Move core app data to Postgres
- Introduce a proper backend service
- Replace Firebase storage with S3
- Move realtime features only if needed
- Gradually retire Firebase piece by piece
Good “clean” stacks by team size
Small team / fastest:
- Next.js + Postgres + Prisma + Auth.js + Stripe + Vercel + Supabase/Neon
Medium team / scalable:
- Next.js + NestJS + Postgres + Redis + Prisma + Auth.js/Clerk + Stripe + Fly.io/AWS
More enterprise / strict control:
- Next.js + NestJS + Postgres + Redis + Kafka/SQS + Keycloak + S3 + AWS
If you want, I can suggest:
- a stack optimized for small SaaS,
- a stack optimized for scale and maintainability, or
- a Firebase replacement map feature by feature.