Service Models

What Is Backend as a Service (BaaS)? Firebase and Examples

Backend as a Service (BaaS) explained: what it includes, how it differs from PaaS and serverless, and examples such as Firebase, Supabase and AWS Amplify.

On this page
  1. Short answer
  2. What BaaS includes
  3. How BaaS works
  4. Firebase as an example
  5. Other BaaS options
  6. BaaS vs PaaS vs serverless
  7. Strengths and trade-offs
  8. Security basics before launch
  9. Planning an exit
  10. Common misconceptions
  11. Frequently asked questions

Short answer

Backend as a service (BaaS) gives developers ready-made backend features, such as user authentication, databases, file storage, push notifications, hosting and sometimes serverless functions. They reach these features through SDKs and APIs, so the frontend talks to them directly. BaaS is usually classed as a subset of platform as a service (PaaS).

What BaaS includes

Most BaaS products offer some combination of these services:

  • Database management, often with real-time data sync
  • User authentication, including sign-up, login and social sign-in
  • Cloud storage for user files and media
  • Push notifications for mobile apps
  • Hosting for the frontend
  • Serverless functions for custom logic that the built-in features do not cover

Some vendors also offer remote configuration, analytics and crash reporting. Mobile-focused offerings are sometimes called mobile backend as a service (MBaaS). The two terms overlap, and some sources treat them as the same.

How BaaS works

With BaaS, the developer writes the frontend and any custom logic. The vendor runs the servers, databases and scaling. The developer does not provision or patch servers, virtual machines or containers. Because the features come ready-made, a small team can often launch a working app quickly.

Firebase as an example

Firebase is a BaaS platform founded in 2011 by James Tamplin and Andrew Lee. Google acquired it in October 2014.

Firebase offers two database products:

  • Realtime Database, which stores data as one JSON tree and syncs changes live to connected clients
  • Cloud Firestore, which stores data as documents in collections and became generally available in January 2019

These are separate products, with different data models and query features.

Firebase also includes authentication, cloud storage, hosting, Cloud Functions, Cloud Messaging (FCM), Crashlytics, Remote Config and Analytics. It has two plans. The Spark plan has free quotas, and the Blaze plan is pay as you go. Check the current limits on Firebase’s pricing page before you plan around them.

Firebase is popular because it is quick to start with, supports real-time sync and offline use, and includes built-in sign-in providers. Its weaknesses are lock-in, per-operation costs that can grow, and limited querying. Firestore, for example, has no native joins.

Other BaaS options

Other BaaS platforms include:

  • Supabase, launched in 2020, is open source and built on PostgreSQL, so it suits teams that want SQL.
  • AWS Amplify, launched in 2017, is Amazon’s framework and backend toolkit for web and mobile apps.
  • Appwrite can be self-hosted and offers authentication, databases and storage.
  • PocketBase and Convex are smaller options with their own strengths.

BaaS providers can also disappear or change direction. Facebook acquired Parse in April 2013. Parse shut down in January 2017, and its code was open-sourced as Parse Server. Choose a provider with that risk in mind.

BaaS vs PaaS vs serverless

Model What you write What the provider runs Example
BaaS Frontend and any custom logic Ready-made auth, database, storage and more Firebase, Supabase
PaaS Your own backend code Runtime, scaling and the operating system Heroku, Google App Engine
Serverless (FaaS) Functions that run in response to events The servers and scaling AWS Lambda

The categories overlap. Many BaaS providers also offer serverless functions. The main difference is that BaaS gives you ready-made backend features, while PaaS gives you a platform for code you write yourself. For the wider comparison, see IaaS vs PaaS vs SaaS compared.

Strengths and trade-offs

Strengths

  • Faster starts, especially for prototypes and small teams
  • No servers to maintain
  • Built-in features such as real-time sync and sign-in
  • Scaling handled by the provider

Trade-offs

  • Lock-in, because each platform has its own APIs and data formats
  • Costs that can rise with usage, especially per-operation pricing
  • Less control over the architecture
  • Limited querying, depending on the database

For managed databases that sit under many backends, see what database as a service is.

Security basics before launch

  • Firebase’s web API key is not a secret. It identifies your project. Security Rules and App Check are what protect the data.
  • Replace test-mode rules before launch. Firestore’s test mode allows open reads and writes for 30 days. Keep the rules that match your app’s access needs.
  • Misconfigured rules are a common cause of public data leaks. Test your rules with the emulator or a set of test cases before release.
  • Set budget alerts on pay-as-you-go plans. A runaway read loop can create a large bill quickly.

Planning an exit

Teams often outgrow a BaaS as custom logic or cost grows. Before you commit, check whether you can export your data and user accounts cleanly, and what the provider’s exit terms are. A migration usually takes planning, and the data model is often the hardest part.

Common misconceptions

  • “BaaS means no backend.” Custom logic still needs functions or a server.
  • “BaaS is SaaS.” BaaS is a set of developer tools. End users do not use it directly, so it is not SaaS.
  • “Realtime Database and Firestore are the same product.” They are separate products with different data models.

Frequently asked questions

What is BaaS in cloud computing?

BaaS is a cloud model in which a vendor provides the server-side features an app needs, such as authentication, databases and storage, so the developer can focus on the frontend and custom logic.

Is Firebase a BaaS?

Yes. Firebase is one of the best-known BaaS platforms. It is a Google product that offers real-time databases, authentication, storage, hosting and serverless functions.

How does BaaS differ from serverless?

Serverless runs functions in response to events, and the provider manages the servers. BaaS is a bundle of ready-made backend services that you connect to from the client. Many BaaS providers also offer serverless functions, so the two often appear together.

The complete guide to service models

IaaS vs PaaS vs SaaS: Cloud Service Models Compared With Examples
Read the guide

Keep exploring

Guides from other topics

All topics →