Founders ask me "should we just use Firebase?" on almost every discovery call, so I wrote up how I actually choose between Firebase, Supabase and a backend of your own. Then I did the slightly uncomfortable thing and held my own two SaaS products up to that guide.

One runs on Firestore. The other runs on Postgres hosted by Supabase. And when I read the code, I noticed something I had never said out loud: I don't use either of them as a backend-as-a-service. Both apps are Next.js API routes with a managed database behind them. Here is what that looks like, and where each database still pushed back.

The two apps

Upwork Scout (upwork-scout.com) sends freelancers AI-matched Upwork job alerts. A scheduled scan pulls new jobs per category into a shared pool, matches them against each user's filters, optionally scores them with Claude, and emails the ones that pass. Storage is Firestore, accessed only through firebase-admin on the server.

VoiceDash is a white-label client portal for agencies that resell Retell voice agents. Agencies have workspaces, workspaces have clients, clients have agents, agents have conversations, and billing hangs off all of it. Storage is PostgreSQL on Supabase, and the app reaches it only through Prisma.

What I don't use

Neither app ships a Firebase or Supabase client SDK to the browser. There are no Firestore security rules in the Upwork Scout repo and no row level security policies in VoiceDash's migrations, because no browser ever talks to either database directly.

Auth isn't the provider's either. Upwork Scout has its own magic links: a jose JWT with a purpose claim (magic, session or unsub) so an unsubscribe token can never double as a login. VoiceDash uses Auth.js with a credentials provider and JWT sessions, and the users live in a Prisma table.

So the guide's advice to "keep business logic in a thin layer you own" turned out to describe both apps by default. Every read and write goes through a route handler I wrote. Rules-as-business-logic, the thing I warn clients about, never had a chance to appear.

The trade is that I gave up the parts of a BaaS that are actually magic: offline sync, realtime listeners, client-side queries without an API. Neither product needs them. A job alert is an email. A call log is a table you look at after the call.

Firestore: where it fit

Upwork Scout's data is not the textbook "each user owns their documents" case. It's a fan-out: one shared pool of jobs, many users, and a verdict per user per job. Firestore handled the awkward middle better than I expected, mostly through document IDs.

export const matchesCol = () => db().collection("matches"); // AI verdicts, `${uid}_${jobId}` 

The match verdicts and the deliveries both use ${uid}_${jobId} as the document ID. That ID is my composite unique key. Before scoring a job with Claude, the scan reads that doc; if it exists, the verdict is reused and I don't pay for the model call twice. Before emailing, it reads the delivery doc; if it exists, the user already got that job. No unique index needed, because the key is the address.

Schema changes were also nearly free. When I added a second generation of filters, I didn't migrate a single document:

const filters = { ...DEFAULT_FILTERS, ...(u.filters || {}) }; // v1 docs lack v2 keys 

Every new job field is optional, and old user docs pick up defaults on read. Compare that with VoiceDash, where I found three Prisma migrations applied by hand and a build that never runs them. Schema-on-read has real costs, but "forgot to run the migration" isn't one of them.

Firestore: where it pushed back

The joins are loops. The dashboard feed reads the user doc, queries the newest 250 jobs from the last 72 hours, filters them in JavaScript, then reads one match doc per job it keeps:

const verdicts = await Promise.all( matched.map(async (j) => { const m = await matchesCol().doc(`${uid}_${j.id}`).get(); return m.exists ? (m.data() as MatchDoc) : null; }), ); 

That's up to 311 document reads for one page load, and Firestore bills per read. In Postgres it would be one query with a LEFT JOIN. At a couple dozen active users it costs nothing worth measuring, which is exactly why I never noticed it. The daily digest does the same thing: two reads per queued job, per user.

The filters live in JavaScript. A user can set around twenty filter fields: budgets, hourly ranges, experience levels, client spend, countries, proposal counts. Firestore can express some of that with composite indexes, but not twenty optional filters in any combination a user picks. So the route fetches the newest 250 jobs and filters in memory. That works until more than 250 jobs land inside 72 hours. After that, older jobs fall out of the window before a single filter runs, and a user with narrow filters sees fewer matches with no error anywhere.

The lock isn't a lock. The scan guards against overlapping runs like this:

const lock = await lockRef.get(); if (lock.exists && now - (lock.get("ts") || 0) < 10 * 60_000) { /* skip */ } await lockRef.set({ ts: now }); 

Read, then write. Two runs that start within milliseconds of each other both see an old timestamp and both proceed. The same check-then-set pattern guards the delivery docs. Firestore has the right tools, a transaction or doc.create(), which fails if the document already exists. I just didn't use them. Postgres would have pushed me toward a unique constraint, which can't be raced.

Postgres on Supabase: where it fit

VoiceDash is relational to its core. The first migration created 24 tables, and workspaceId with onDelete: Cascade runs through most of them. Billing reports, call analytics and "which client owns this agent" are questions SQL was built for, and Prisma gives me typed queries over them. When I wrote about building a white-label multi-tenant SaaS, tenant isolation was the hard part; foreign keys and composite uniques like @@unique([workspaceId, userId]) do a lot of that work for free.

And the exit door is real. It's a Postgres connection string. If I left Supabase tomorrow, I would pg_dump, restore somewhere else and change one environment variable. Prisma wouldn't notice.

Postgres on Supabase: where it pushed back

The most Supabase-specific file in the repo isn't code. It's a GitHub Actions workflow:

# Supabase free-tier projects pause after 7 days of inactivity. 

A daily job queries one row through Supabase's REST endpoint so the project never goes quiet long enough to pause. The comment explains why it runs daily instead of every six days: a single skipped or delayed GitHub run shouldn't be able to take the database down. I learned how much to trust GitHub's scheduler the hard way on the other app, so I'm glad that margin is there. But a production app whose database depends on a cron job pinging it is a free-tier trade-off. The fix is the paid plan, not more cleverness.

The other push back is the one the guide predicts: schema changes are my job, and I haven't always done that job well.

What I would tell myself on day one

  1. Pick by the main screen's data, not by habit. A pool of jobs plus per-user verdicts fits documents with clever IDs. Workspaces, clients, agents and invoices fit tables. I got both calls right mostly by accident.
  2. Using the database without the BaaS is a legitimate choice. Server-only access gave me one place for logic and no rules to test. It cost me offline sync and realtime, which these products don't need.
  3. In Firestore, design document IDs like unique keys. ${uid}_${jobId} saved me from both duplicate emails and duplicate model calls.
  4. Count reads per page, not per query. A loop of .get() calls is a join you pay for row by row.
  5. Use the atomic primitive. create() or a transaction in Firestore, a unique constraint in Postgres. Never read-then-write for anything that must happen once.
  6. Know what the free tier does when you're not looking. Firestore bills reads; Supabase's free tier pauses idle projects.

None of these fixes is shipped yet. The lock and delivery writes moving to create() is first, because it's a few lines.

The guide this is adapted from, with the four questions I ask clients before picking a backend, is on my site: Firebase vs Supabase vs your own backend for an MVP.

Do you use Firebase or Supabase as a full BaaS, client SDK and rules included, or just as a database behind your own API like I do? I'm curious which way most small SaaS teams actually go.