Firebase

Also known as: Google Firebase

On this page 7

Firebase is Google’s backend-as-a-service platform that provides web and mobile applications with managed databases, user authentication, file storage, hosting and serverless functions through client SDKs, without the developer operating any servers. In serverless cloud architecture, Firebase is the leading example of backend as a service: instead of writing an API layer, the client application often talks to managed services directly, protected by declarative security rules.

Also known as Google Firebase, the platform runs on Google Cloud infrastructure. Every Firebase project is simultaneously a Google Cloud project, so teams can start with the simplified Firebase console and later add Google Cloud services such as BigQuery or Cloud Run to the same project.

How Firebase delivers a backend without servers

Firebase replaces a custom backend with managed services that clients call through SDKs. A mobile or browser app signs the user in with Firebase Authentication, receives an ID token, and then reads or writes data in Cloud Firestore or Cloud Storage directly; each request carries the token so the service can evaluate access.

Access control lives in Firebase Security Rules, a declarative language deployed alongside the project. Rules check conditions such as whether the signed-in user owns a document or whether incoming fields have valid types. Because no trusted server sits between client and database, these rules are the security boundary.

Logic that must not run on the client, such as payment processing or sending emails, goes into Cloud Functions for Firebase. These functions execute in response to triggers such as HTTPS requests, database writes, authentication events or schedules, and they scale to zero when idle.

Core Firebase services

Firebase bundles build, run and quality services under one console and one set of SDKs. The table summarizes the services that matter most for backend work.

ServiceWhat it providesTypical use
Cloud FirestoreDocument database with real-time listenersApp data, user profiles, chat
Realtime DatabaseJSON tree synchronized in real timePresence, simple live state
Firebase AuthenticationSign-in with email, phone and identity providersUser accounts and tokens
Cloud Storage for FirebaseObject storage with rulesPhotos, videos, uploads
Cloud Functions for FirebaseEvent-driven serverless functionsServer-side logic and integrations
Firebase HostingStatic and dynamic web hosting on a CDNSingle-page apps, landing pages
Cloud MessagingPush notifications to devicesAlerts and re-engagement
Main Firebase services and their roles

Further services such as Crashlytics, Remote Config, Performance Monitoring and Analytics support app quality and gradual feature rollouts. Most of them are free, while databases, storage and functions are billed by usage on the pay-as-you-go Blaze plan.

Firestore compared with the older real-time database

Firebase offers two NoSQL databases with different data models and scaling behavior, and choosing between them is one of the first design decisions in a project. Cloud Firestore is the recommended default for new applications.

PropertyCloud FirestoreRealtime database
Data modelCollections of documentsOne large JSON tree
QueriesIndexed, compound, with sortingLimited, single-property sorting
Billing basisDocument reads, writes and deletesBandwidth and stored data
Offline supportWeb, Android and Apple platformsAndroid and Apple platforms
ScalingAutomatic, multi-region optionsSharding across database instances
Best fitMost new applicationsVery frequent small state updates
Choosing between the two Firebase databases

The billing difference shapes data design. In Firestore, a screen that loads 500 documents costs 500 reads every time it opens, so developers denormalize data and paginate queries to keep costs predictable.

Firebase compared with other serverless approaches

Firebase sits at the most managed end of the serverless spectrum. Function-as-a-service platforms run code that the developer writes, whereas backend as a service also supplies the data, identity and file layers ready to use.

OptionWhat the developer managesMain trade-off
FirebaseClient code, rules, optional functionsFastest start; strongest platform coupling
AWS Lambda with API GatewayFunctions, APIs, separate databaseFlexible; more assembly required
Google Cloud RunContainerized servicesAny language or runtime; more operations
Self-hosted backendServers, scaling, patching, databaseFull control; highest operational load
Firebase against neighboring serverless options

Teams often move along this spectrum over time: Firebase for the first release, then Cloud Run or dedicated services for workloads that need long-running processes, relational queries or fine-grained cost control.

Limitations, risks and common mistakes

Firebase trades control for speed, and most incidents stem from rules and billing rather than outages. The following points recur in production reviews.

  • Open security rules: test-mode rules that allow all reads and writes expose the entire database if they reach production.
  • Unbounded reads: listeners on large collections or loops in client code can multiply billed operations; set budget alerts in the console.
  • Vendor lock-in: Firestore queries, rules and SDK patterns do not transfer directly to other databases, so migration requires a rewrite.
  • Limited querying: Firestore lacks joins and full SQL; complex reporting usually requires export to BigQuery.
  • Cold starts: Cloud Functions can add latency after idle periods; minimum instances reduce it at a fixed cost.
  • Exposed configuration: the web API key is public by design, so protection must come from rules and App Check, not secrecy.

Experienced teams mitigate these risks with a few habits. They test security rules in the Local Emulator Suite before every deployment, keep rules and indexes in version control, separate development, staging and production into distinct projects, and review the usage dashboard weekly so that a runaway listener is caught within days rather than at the end of the billing cycle.

In plain words

Most apps need a place to store data, a way for people to log in and a way to send them messages. Building all of that usually means renting and maintaining servers. Firebase is a ready-made back office for apps, supplied and run by Google.

Developers plug their app into it and write rules about who may see what. Google handles the machines, the growth in users and the backups. The main catch is dependence: moving away later takes real effort.

A real-world example

A three-person startup builds a booking app for local fitness studios. With no backend engineer on the team, the founders use Firebase Authentication for sign-in with email and phone numbers, Cloud Firestore for studios, classes and bookings, and Cloud Messaging to remind members one hour before class.

Payments run in a Cloud Functions HTTPS endpoint so that card processing never happens in the client. Security rules let each member read only their own bookings and let studio staff edit only their own schedules. A budget alert is set at a modest monthly amount on the Blaze plan.

The team ships the first version in about six weeks. At 15,000 monthly users, the bill stays in the low hundreds of dollars, and the founders later move only the reporting workload to BigQuery, keeping the rest of the backend fully managed.