Mobile App Backend Development: Do You Need a Custom Backend?
When Firebase or Supabase is enough for an app backend, when a custom backend pays off, and how data location, limits and exit plans change the decision.
Does your app need a custom backend?
Usually not at the start. If your app needs accounts, a database, file uploads, push notifications and straightforward access rules, a backend-as-a-service (BaaS) such as Firebase or Supabase can cover it, and you only write the logic that is specific to your product. A custom backend, or a custom service alongside the BaaS, becomes worth it when one of these is true: business rules are too complex or too sensitive to live in client code and security rules; jobs run longer than managed functions allow; you need relational reporting across a lot of data; a customer or regulator needs data in a country your provider does not offer; or you must integrate deeply with systems you already run.
Most products end up hybrid: managed sign-in, storage and messaging, plus a custom API for the parts of the business that make money. The choice that is hardest to undo is not BaaS versus custom. It is where the data lives and how it is modelled. Firestore's location, for example, cannot be changed once the database exists, so settle residency before the first record is written.
This guide is for founders and product owners scoping an app. For how the app itself is structured, see mobile app architecture. The second half of this page lists the components a backend is made of.
Key takeaways
- BaaS fits standard accounts, data, storage and realtime features; it is a sensible default for a first version.
- Move a feature to custom code when it hits a limit, needs tamper-proof logic or needs a long-running job. Rarely move everything at once.
- Choose the data region before launch. Firestore's location is fixed after creation.
- Neither Firestore nor Supabase lists a UAE region at the time of writing.
- Write an exit plan early: what exports cleanly, and what you would have to rewrite.
- Custom backends need people to run, patch and monitor them. Count that before choosing one.
Managed, custom or hybrid: what each means
The three options differ in what you build, what you depend on and how cost behaves as usage grows. Managed platforms are mostly usage-based (operations, storage, bandwidth, function calls), so the bill follows activity. A custom backend is mostly infrastructure you size yourself, plus the people who maintain it. Check each vendor's current pricing page rather than relying on figures quoted elsewhere.
| Approach | What you build | What you depend on |
|---|---|---|
| BaaS (for example Firebase, Supabase) | Screens, data model, security rules, a few server functions | The vendor's auth, database, storage, functions, regions and limits |
| Hybrid | BaaS for sign-in, storage and messaging; a custom service for core business logic | Both, with a clear boundary between them |
| Custom backend | API, database schema, auth integration, jobs, admin tools, infrastructure | A cloud provider and a team that can operate it |
Architecture decision table
Go through each row for your app. If most answers fall in the first column, start on a BaaS. A few answers in the middle column mean adding server functions or one custom service. Several in the last column mean planning a custom backend from the start.
| Area | Stay on BaaS when | Add functions or a custom service when | Plan a custom backend when |
|---|---|---|---|
| Auth | Email, phone and social sign-in cover your users | You need roles per organisation or must exchange tokens with another system | Identity must live in a system you already run, or each customer brings its own sign-in |
| Data model and rules | Data belongs to a user or a team, and access can be written as a rule on each record | Rules need lookups across several records (Firestore Security Rules allow 10 get() or exists() calls per single-document request) | Permissions depend on complex multi-tenant relationships, or you need joins and transactions across many tables |
| Server-side logic | Logic is light: validation, triggers, sending a notification | Prices, payments, entitlements or anything a user must not be able to change from the app | The core business process (quotes, matching, ledgers) needs its own tested codebase |
| Jobs and webhooks | Short tasks triggered by events | Payment or partner webhooks need verifying, retrying and logging | Imports, reports or batch jobs run longer than managed function limits |
| Data residency | The provider offers a region in the country you need | Some data must stay in-country while the rest can live elsewhere | The country is not offered, or contracts require your own cloud account and controls |
| Export and lock-in | You have tested an export and accept the rewrite cost | Core data needs to be queryable in SQL or a warehouse | A customer or acquirer requires the stack to run in your own environment |
| Limits | Usage sits well inside documented quotas | One feature hits a limit; move that feature | Several core features push against limits |
| Integrations and reporting | Few integrations; product analytics covers reporting | One or two systems to sync, or exports to a warehouse | Two-way sync with ERP or CRM, and heavy relational reporting |
| Team | No backend engineer yet | One developer can own a small service | You have, or will hire, people to run servers |
When BaaS stops fitting
The signals are usually specific rather than general. Security rules become hard to read or test because they encode business logic. Client code starts doing things only a server should do, such as calculating a price. A report needs data from many collections at once. A payment webhook needs retries and an audit trail. A customer asks for data to stay in a country your region list does not include. Or usage-based costs climb faster than revenue for one heavy feature.
The usual response is to move that one thing, not to rewrite the backend. Put the pricing logic behind an API, run the long job on a worker, or keep orders in a relational database while chat stays where it is. If the app talks to several external systems, scoping that integration is its own piece of work; see what drives API integration cost.
Where your data lives
Region choice matters for latency, contracts and, in some sectors, law. On Firebase you choose a location for Firestore, Realtime Database, Cloud Storage buckets, Cloud Functions and some other products; Cloud Functions default to us-central1 if you do not set one. Firebase notes that some products do not support location selection, so do not assume every part of the platform is regional. Once a Firestore database is created, Firebase says you cannot change its location.
The table shows the regions each vendor listed for these markets when we checked (vendor data, 14 October 2026). Supabase's region page does not say whether a project's region can be changed later.
| Market | Firestore | Supabase |
|---|---|---|
| India | asia-south1 (Mumbai), asia-south2 (Delhi) | ap-south-1 (Mumbai) |
| UAE | No UAE region; nearest listed are me-central1 (Doha) and me-central2 (Dammam) | No Middle East region listed |
| Australia | australia-southeast1 (Sydney) | ap-southeast-2 (Sydney) |
| UK | europe-west2 (London) | eu-west-2 (London) |
| Singapore | asia-southeast1 (Singapore) | ap-southeast-1 (Singapore) |
Worth noting
Where data is hosted and where it may be transferred are different questions. India's Digital Personal Data Protection Act takes a negative-list approach to cross-border transfers: the government may restrict transfers to countries it notifies, and stricter sector rules (for example from the RBI) still apply. The UAE's PDPL sets requirements for cross-border transfer, and the DIFC has its own law. Australia's APP 8 sets steps before disclosing personal information overseas. These summaries are high level, partly from law-firm commentary, and are not legal advice; confirm what applies with counsel.
Limits that shape the design
Every managed platform has documented limits. They rarely matter for a first version, but they decide where custom code is needed later. A few that tend to come up (vendor documentation, checked 14 October 2026):
Firestore: a document can be at most 1 MiB, transactions can run for up to 270 seconds, and Security Rules allow 10 get() or exists() calls for a single-document request (20 for multi-document requests). Composite indexes are capped at 200 without billing enabled and 1,000 with it. Large lists inside one document, or rules that need many lookups, are early signs that the data model needs rethinking.
Supabase Edge Functions: 256 MB of memory, 2 seconds of CPU time per request, and a wall-clock limit of 150 seconds on the Free plan and 400 seconds on paid plans. Anything heavier, such as large imports or report generation, belongs on a separate worker.
Limits change, so re-check the vendor pages when you design a feature that is close to one.
Exit plan: what you can take with you
Lock-in is less about the database than about everything wired to it. Developers in community discussions describe leaving Firebase as rewriting several layers at once, because auth, storage and security rules are tied together. Write down what you would take and what you would rebuild before you need to.
Firestore managed export writes files to a Cloud Storage bucket. It needs the pay-as-you-go Blaze plan, is billed as one read per document exported, is not an exact point-in-time snapshot, and can be loaded into BigQuery. Supabase projects are Postgres, so a backup is three `supabase db dump` commands for roles, schema and data; Storage objects are not in the dump and have to be moved separately. Supabase can also be self-hosted with Docker Compose, but the self-hosted version lacks branching, managed backups and point-in-time recovery, advanced metrics, ETL and the Management API, and you take on availability, scaling, security and updates.
- Run a real export to a test environment and check it restores
- List the data the export does not include (files, auth users, logs)
- List every place the app calls the vendor SDK directly
- Document security rules as plain business rules, so they can be rebuilt elsewhere
- Keep core business data (orders, payments, accounts) in a model you could move to SQL
- Note which features depend on vendor-only services
Hypothetical example: a home-services booking app
Hypothetical example: a start-up launches a booking app for home repairs. Version one uses a BaaS in a Mumbai region for sign-in, customer profiles, bookings and chat, with functions to send confirmations. Six months later it adds card payments and a weekly payout report for technicians. Payment webhooks and payouts move to a small custom service with its own relational database, because they need retries, an audit trail and reporting across many bookings. Chat and profiles stay on the BaaS. When the team later signs a partner who requires UAE in-country hosting, the regional table shows neither vendor offers it, so that partner's data goes to infrastructure in the UAE run by the team. Each move is triggered by a specific row in the decision table, not by a general rewrite.
When a custom backend is the wrong call
A custom backend is not automatically more professional. It is the wrong choice when the product is still being validated, when no one on the team can operate servers, or when the reason is a vague fear of scale rather than a specific limit. It adds work that a BaaS already does well: sign-in, password resets, file storage, monitoring and patching. If you build custom, budget time for operations as well as development, and see planning for scale for what actually needs to scale.
Common mistakes
- Creating the production database in a default region and discovering later it cannot be moved
- Putting prices, discounts or entitlements in client code because the BaaS made it easy
- Encoding complex business rules in security rules that no one can test
- Choosing custom for an unvalidated MVP and spending the budget on infrastructure
- Never testing an export, so the exit plan exists only on paper
- Leaving Cloud Functions on their default region while data sits elsewhere
What a mobile app backend is made of
Whichever route you choose, the components are the same. The difference is who builds and runs each one.
| Component | What it does | Needed when |
|---|---|---|
| APIs | The contract the app uses to read and write data | Almost always |
| Database | Stores users, content, transactions | Any shared or synced data |
| Authentication | Sign-in, sessions, roles | Accounts or personalised data |
| File storage | Images, documents, media | User uploads or rich content |
| Notifications | Push, email, SMS | Re-engagement or time-sensitive updates |
| Payments | Purchases, subscriptions, refunds | Anything sold |
| Admin panel | Staff tools for users, content, orders | Most business apps |
| Analytics | Usage and conversion events | Always recommended |
| Integrations | CRM, ERP, logistics, AI services | Connecting to existing systems |
| Cloud infrastructure | Hosting, scaling, monitoring | Any backend |
APIs, data and authentication
The API is how the app talks to everything else. Design it around what screens need, secure every endpoint, and plan for versioning, because older app versions stay installed long after you release updates. See REST vs GraphQL for mobile apps for choosing an API style, and connecting the app to its APIs for the client side.
Choose a database that fits the data: relational databases suit structured, related data like orders and accounts; document stores suit flexible content. Store files in object storage behind a CDN, and never let the app access storage without authorisation.
Use proven providers or libraries for sign-in. If the app uses a third-party or social login for the user's main account, Apple's Guideline 4.8 requires an equivalent login option with privacy features, such as limiting data to name and email; Sign in with Apple is the usual way to meet it. Support token refresh and account deletion, which both app stores require for apps that let users create accounts; Apple also asks apps using Sign in with Apple to revoke the user's tokens when an account is deleted. The mobile app authentication guide covers sign-in methods, tokens and sessions in depth.
Notifications, payments and admin
Push notifications travel from your backend through Apple Push Notification service and Firebase Cloud Messaging. The backend decides who gets what and when, stores device tokens, and respects users' notification preferences. See push notifications in mobile apps for strategy and implementation.
Store rules require in-app purchase for many digital goods and subscriptions, while physical goods and services typically use a payment provider. In both cases the backend should verify payment status server-side before granting access or fulfilling orders; see payment gateway integration and, for the app side, mobile app payments.
Staff need tools to manage users, content, orders and support. Build these alongside the app rather than after launch, and track key product events from day one so you can see where users succeed and drop off.
Integrations and infrastructure
Apps often need to connect to CRMs, ERPs, logistics or AI services, handled server-side where credentials stay safe. Host on cloud infrastructure with monitoring and automated deployment. See ZSpace Labs' AI automation work for AI-powered backend features.
What Different Apps Typically Need
| App type | Core backend needs |
|---|---|
| Content or media | APIs, CMS, file storage and CDN, notifications, analytics |
| Commerce | Catalogue, cart, payments, orders, inventory, admin, notifications |
| Booking | Availability, scheduling, payments, reminders, admin |
| Social or community | Accounts, feeds, real-time messaging, moderation, media storage |
| Fintech | Strong authentication, audit logs, secure integrations, compliance controls |
| Internal tools | SSO, role-based access, integrations with business systems, offline sync |
Conclusion
Start on a managed backend unless a specific row in the decision table says otherwise, choose the data region deliberately before launch, and move individual features to custom code when they hit a real limit. Keep an exit plan you have actually tested. If you are scoping a new build, ZSpace Labs works on mobile app development including backends and APIs. For how this fits the whole build, see the mobile app development guide.
Want a second opinion on your backend before you commit?
ZSpace Labs is a remote-first technology studio that works with clients globally on mobile apps and their backends. If useful, we can go through the decision table with you and look at data location, limits and your exit plan.
Sources
Firebase (vendor documentation): Cloud Firestore locations; Firebase project locations; Firestore usage and limits; Firestore export and import.
Supabase (vendor documentation): available regions; Edge Functions limits; backup and restore using the CLI; self-hosting.
Apple: offering account deletion in your app; App Review Guidelines (4.8 Login Services).
Law and regulation: UAE government: data protection laws; OAIC: Australian Privacy Principles quick reference; King Stubb & Kasiva: cross-border data transfers under the DPDP Act (law-firm commentary).
Accessed 14 October 2026. Vendor regions, limits and plans change; check the current pages before deciding. Nothing here is legal advice.
Common questions.
The server-side systems an app relies on: APIs, databases, authentication, file storage, notifications, payments, admin tools and integrations with other services.
No. Simple utilities that store data only on the device may not. Any app with accounts, shared data, payments or notifications does.
Managed platforms such as Firebase and Supabase that provide authentication, databases, storage and server functions without you building and running servers. They speed up development for standard needs, within the vendor's limits and regions.
When business logic is complex or must not be tampered with, data must integrate deeply with existing systems, jobs outgrow managed function limits, data has to stay in a country your provider does not offer, or managed services become limiting or expensive at your scale. Often only part of the backend needs to be custom.
No. Firebase's documentation says that once you create a Firestore database you cannot change its location setting. Moving means creating a new database in the right location and migrating the data.
Not at the time of writing. Firestore lists Doha and Dammam in the Middle East, and Supabase lists no Middle East region. Check the vendors' region pages, as these lists change.
Yes, but plan for it. Firestore can export to a Cloud Storage bucket and Supabase databases can be dumped with standard Postgres tooling, but authentication, security rules and client code that calls the vendor SDK usually have to be rewritten.
Your backend sends messages through Apple Push Notification service for iOS and Firebase Cloud Messaging for Android, which deliver them to devices.
Most business apps do, so staff can manage users, content, orders and support without developer help.
Through the app stores' in-app purchase systems for digital goods and subscriptions where store rules require it, and through a payment provider for physical goods and services, with the backend confirming payment status.
Yes, and it's usually a good idea. A shared API keeps data and business rules consistent across channels.