zero gravitySOLUTIONS
← All insightsSAAS ENGINEERING / REQUIREMENT DECISION SHEET

Firebase or a custom backend?

QUICK ANSWER

Choose the backend for a bounded product capability, not for an imagined final platform. Firebase can suit client-driven document workflows when its data and permission model fit. Add a custom business boundary when privileged decisions, complex coordination, or integration contracts require server-owned behavior.

Inside this article 6 sections

Firebase and a custom backend are not mutually exclusive product identities. A SaaS can use Firebase Authentication and Firestore for a collaborative interface while routing consequential operations through a server-owned API. The decision becomes clearer when applied to one capability with explicit trust, consistency, and recovery requirements.

Consider a field-inspection feature. Inspectors draft reports, attach photographs, and work with intermittent connectivity. Supervisors approve completed reports, which may trigger a customer notification and update a billing record. Draft editing and approval have different needs, even though the interface presents them as one workflow.

Describe the smallest useful product slice

Write the actions before choosing storage: create a draft, edit observations, upload evidence, submit a revision, approve it, and export an approved report. For each action, name the actor, allowed account scope, required data, and externally visible consequence. This separates convenient client synchronization from business authority.

A draft can often tolerate delayed synchronization and clearly displayed conflicts. Approval cannot simply mean that a browser changed a status field. It may require a supervisor role, a specific report revision, completion checks, and evidence that the approval has not already triggered a downstream operation. Put those requirements in the decision sheet rather than adding them after a prototype becomes production.

Illustrative inspection capability: requirement-led boundary
ActionRequired guaranteeBoundary to evaluate
Edit personal draftTenant-scoped access and understandable synchronizationClient SDK with tested document rules
Approve revisionCurrent permission and atomic revision transitionServer-owned business operation
Notify customerDurable intent and duplicate-safe recoveryBackground integration adapter
Portfolio reportingDeclared filters, ordering, and account isolationTest actual queries and indexes before choosing storage
The same feature can use different boundaries for draft collaboration and consequential approval. The requirement determines the split.

Test permissions through every access path

For direct Firestore client access, design document paths and Security Rules around the account model. Being signed in is insufficient if every signed-in user can read another customer's report. Test a member of account A against account B's identifiers, a removed member with a stale interface, and an inspector attempting a supervisor-only transition.

Queries must also fit the rule and data model. A screen that lists all reports and filters unauthorized ones in the browser has already crossed the boundary. Build the intended query and permission test together. Include collection-level reads, not only direct access to one known document, because list screens frequently expose assumptions absent from detail screens.

Privileged server clients use a different security path: they bypass Firestore Security Rules and rely on server credentials and IAM. Therefore, moving approval into a server function does not automatically preserve the client's authorization guarantees. The function must verify the caller and tenant membership, then perform the business permission check before using privileged access.

Keep retries away from external effects

Firestore transactions can rerun their callback when concurrent edits affect the read documents. A transaction callback that sends a customer email may therefore repeat the send. Keep the callback focused on database state and persist a separate notification intent. Execute the external operation afterward through a recovery-aware worker with a stable identity.

For approval, read the submitted revision, confirm the expected version and eligible status, and write the approval transition together with its durable intent where the storage model permits. A losing concurrent approval should return an explainable conflict or the existing outcome. A timestamp written by the client is not a substitute for an atomic state transition.

Offline editing needs separate promises. A locally visible draft does not establish that a transaction-dependent approval succeeded while disconnected. Show pending synchronization distinctly from accepted approval, and define how the app resolves an edit made against an older revision. This product behavior matters more than a broad claim that the backend “supports offline.”

Exercise the difficult query before committing

Build a realistic portfolio screen: approved inspections for selected sites within a date range, filtered by severity and ordered by completion time. Populate a representative synthetic dataset, including a large customer and sparse fields. Record required indexes, read patterns, pagination behavior, and how permission filtering affects the query.

Do the same for the plausible custom-backend design. A relational schema may simplify reporting and cross-entity constraints while requiring more implementation and operations. A document model may simplify fetching one report while needing deliberate denormalization for a portfolio view. Compare completed screen behavior and operational work, not just the number of lines in the first write endpoint.

Estimate costs using the actual access pattern: live subscriptions, repeated reads, attachment storage, background operations, and data transfer. Keep assumptions explicit and use current provider pricing during implementation planning. An architectural decision should remain understandable without relying on a promotional free tier or a traffic estimate that nobody has validated.

Use a product slice to commission the backend decision

If the team is deciding whether to keep Firebase central or introduce a custom backend, commission a representative capability with explicit acceptance cases. Include the user interface, permission boundary, consequential server operation, and one difficult query. The point is to observe whether each design can meet the same product requirement under realistic constraints, rather than to build two complete applications for comparison.

Ask for an access-path map, executable permission fixtures, a record of the query experiment, and a demonstrated export of representative data. The implementation should show where authoritative business rules live and how an existing client behaves when an operation fails. A receiving engineer should be able to repeat the experiment and distinguish a product requirement from a provider-specific implementation choice.

A decision experiment is useful when the architecture choice is still open. A scoped build is suitable when the capability and trust boundary are already clear. Ongoing delivery becomes appropriate as the product accumulates integrations and independent consumers. We can preserve the useful parts of your current stack while testing the specific boundary that needs to change, with the prototype evidence available for your team to challenge.

Write migration triggers before they become emergencies

Useful triggers are observable: a required query needs unacceptable duplication, approval spans several independently owned systems, access rules become difficult to verify, or a partner API needs a stable contract independent of the web client. “The product is growing” is too vague to tell a team what to change.

Preserve a domain identity and revision model that does not depend on UI components or provider-specific path strings. Keep privileged business operations behind an adapter, even if the first implementation is a small function. Export and restore representative data during the prototype so that migration is a tested capability rather than an assumed escape hatch.

Run a short decision experiment with the permission probes, approval race, offline edit, reporting query, and export test. Record which design satisfies each requirement and what remains uncertain. The separate API guide explains deployment boundaries, while business modules explain capability ownership. Product implementation can preserve those boundaries whether Firebase remains central or becomes one component of the system.

FROM INSIGHT TO ACTIONCustom software development

Choose the backend boundary through a working product slice.

We can implement the representative flow, verify its trust and data boundaries, and document the evidence for keeping or changing your current architecture.

Explore software developmentDiscuss your build

Start with your goals.
We’ll work through the next step together.