Supabase vs Firebase: After portal login, whose company projects can a customer see?
For an AI-generated client portal, compare membership relationships, query constraints and backend permissions. Supabase RLS, Firestore Rules and Firebase SQL Connect impose different maintenance responsibilities.
AI may have generated the client portal’s pages, and customers may be able to sign in, but that does not mean they can read only their own company’s projects. If projects, members and delivery records have many-to-many relationships, and someone can maintain SQL, evaluate Supabase first. If the existing app is built around document synchronization and mobile offline use, start with Firebase’s Cloud Firestore. Teams already using Firebase that also need relational data should compare SQL Connect as well: needing SQL is not a reason to rule out Firebase outright. This analysis draws on official documentation. Neither portal implementation was tested hands-on.
Decide which permission boundary you will maintain
Supabase connects PostgreSQL with authentication and can restrict row access through Row Level Security (RLS). With Firebase, identify the database: Cloud Firestore organizes data into collections and documents; Realtime Database uses a JSON tree; both are NoSQL. SQL Connect connects to Cloud SQL for PostgreSQL and has its own authorization mechanism for queries and mutations. This article primarily compares Supabase RLS with Firestore client Security Rules, while considering SQL Connect as a relational alternative. It does not treat Firebase’s three databases as one product.
Imagine a service company letting customers view projects. One person may belong to two companies, and a project may invite external members. First define who belongs to which company, who can view each project, and who can change delivery status. Then ask AI to generate the pages and queries. Checking only that a user is signed in puts all customers into the same permission group; hiding another company’s projects in the interface cannot replace data access controls.
Failed queries require different fixes
Supabase’s RLS documentation describes policies as conditions implicitly added to queries. For a client’s project list, database policies can use membership relationships to return only permitted rows. Multiple pages can reuse that database boundary, but the team must understand table privileges, policies and relational queries. Once RLS is enabled, the API cannot access data using a publishable key until policies exist. Verify that generated table-creation scripts actually enable RLS; a functioning page is not proof that permissions are configured.
Firestore’s documentation explicitly states that Security Rules do not filter query results. If a collection query could return documents the user is not allowed to read, the entire request fails. The client’s list query must therefore satisfy the rules itself, for example by restricting results to an authorized company. It cannot fetch every project and expect the rules to remove other customers’ data. Query design and permission design are closely coupled. If AI fixes an error by allowing every signed-in user to read, a working page may conceal a cross-customer leak.
SQL Connect offers a third maintenance approach: configure @auth on queries and mutations, then combine server-side filters and expressions to check resource ownership. Its documentation warns that the USER level checks login only, not whether data belongs to that user. Identity conditions should use verified authentication information such as auth.uid, rather than trust a userId supplied by the client. This route suits teams willing to maintain explicit data operations while continuing to use Firebase Authentication. Its rules language is not directly interchangeable with PostgreSQL RLS.
Validate backend AI calls separately
Whether a browser can exceed its permissions and whether a backend report generator can do so are two separate test paths. Supabase secret keys can bypass RLS through service_role and must not be put in the browser. Firestore server client libraries also bypass Security Rules, with access controlled instead through credentials and IAM. On either platform, passing frontend permission checks does not prove that backend AI can see only the current customer’s data.
If a backend assistant summarizes projects for a customer, the server must verify the caller and their project permissions before restricting the scope of its reads. Passing a company_id from the page unchanged to a broadly privileged backend query reopens a route already closed on the frontend. The selection question is whether the team can keep reviewing that path, rather than which login button is easier to generate.
Budget the same workload, then test counterexamples
Supabase’s pricing page lists Pro from US$25 per month. Paid plans include US$10 in monthly compute credits, enough to cover one Micro instance; adding projects or increasing compute changes the bill. For Firestore, check reads, writes, index reads, storage and network traffic; extra document reads needed to evaluate rules may also be billed. SQL Connect billing separates the service itself from its Cloud SQL for PostgreSQL instance, so Firestore’s free allowance cannot be applied to it. None of these amounts is a complete client-portal quote.
For example, assume 100 customers open a list twice each working day, with each opening actually reading 20 project documents. Over 22 working days, that action alone represents 88,000 document reads. This example excludes cache effects, realtime updates, index reads and additional reads required by rules. It does not mean every read is billable. Have both platforms estimate the same traffic, separately listing authentication methods, attachment storage, backend functions, network traffic, and backup and recovery requirements. Then check what the current plans cover. Unlimited Supabase API requests do not mean compute and traffic have no cost.
Before launch, require the same tests to pass for each candidate: customer A can read their own projects but not customer B’s; a removed project member cannot obtain new data; an update cannot change a project’s ownership to someone else’s company; backend AI summaries cannot read across customers either. Supabase provides database testing options and Firebase provides Security Rules unit-testing tools. Using those tools does not mean these business assertions have already been verified.
If membership relationships and cross-table reporting are central to the portal, and the team can maintain database policies, Supabase deserves the first validation exercise. If the app already depends on Firestore’s document model, realtime synchronization and offline support, retaining that route and testing rules alongside queries is more reasonable. For relational needs, add SQL Connect to the same evaluation. Choose a permission model the team can explain, test and hand over for changes, rather than judging by whether a login demo works.
Content note:This article is based on publicly available information and is intended as a reference for evaluating tools. Features, pricing, and related policies may change at any time; please refer to the latest official information.
Original source:supabase.com