Serverless

Firebase

A backend as a service from Google: Firestore, auth, hosting, Cloud Functions and push messaging.

What it is

Firebase appeared in 2011 as a realtime database and Google acquired it in 2014. Today it is a set of services for mobile and web apps without your own backend.

Main parts: Firestore (NoSQL documents with realtime subscriptions), Authentication, Cloud Storage, Hosting, Cloud Functions, Cloud Messaging (push), Crashlytics and Analytics. Ready SDKs exist for iOS, Android, Web, Flutter.

Data access is protected by Security Rules that describe who may read and write what. The NoSQL model and closed source give a fast start but complicate complex queries and migration to another platform.

Use it when

  • A mobile app that needs auth, push and realtime without its own backend.
  • A prototype or MVP that must ship in days.
  • Chat, collaboration and live updates (Firestore realtime).
  • The team already uses the Google ecosystem and Flutter.

Avoid it when

  • Complex relational data, JOINs and analytics: the NoSQL model is awkward.
  • You need no vendor lock-in and self-hosting ability.
  • Unknown read patterns: bills for read operation counts can grow.

Key concepts

Firestore
A document NoSQL database with collections, indexes and realtime change subscriptions.
Security Rules
Declarative access rules for Firestore and Storage, evaluated on the server.
Authentication
Sign-in via email, Google, Apple, phone and other providers with ready UI.
Cloud Functions
Server functions that react to Firestore, Auth or HTTP events.
Emulator Suite
Local Firebase emulators for development and tests at no cost.

Example

Subscribing to a room's messages in Firestore in realtime.

Interview questions

  1. 1. What are Firebase Security Rules for?

    The client talks to the database directly, so server-side rules decide who reads and writes what. Without them the database would be open to anyone who knows the project key.

  2. 2. What are the weak points of Firestore?

    Limited queries (no JOINs, complex aggregations), a need for denormalization and billing for every read and write. For relational data an SQL database fits better.

  3. 3. How does Firebase differ from Supabase?

    Firebase is closed and NoSQL based, Supabase is open source and built on Postgres. Firebase has stronger mobile SDKs, push and Crashlytics, while Supabase gives SQL and self-hosting.

Logos belong to their owners and are used for identification only. Icons: Simple Icons (CC0), Devicon (MIT).