Blog · Infrastructure
☁️ Infrastructure

Firebase Deep Dive 2026: The BaaS That Ships Apps Fast

Firebase is Google's Backend as a Service (BaaS) platform. It exists to let you ship apps with the smallest possible amount of backend code. For a wide class of consumer iOS apps, that's a great trade. For others, it's a footgun that locks you into a vendor and surprises you with the bill. This post is the working developer's honest tour.

What Firebase is

Firebase started as a real-time database company in 2011, was acquired by Google in 2014, and has since absorbed a wide range of mobile backend services: authentication, file storage, push notifications, analytics, crash reporting, A/B testing, remote config, performance monitoring, and more.

The defining characteristic: your iOS app calls Firebase services directly via the Firebase SDK. There's no backend server you wrote in between. The Firebase SDK in your app authenticates the user, reads/writes Firestore documents, uploads files, subscribes to push notifications, etc. — all directly to Google's infrastructure.

This is the opposite of the Railway pattern (where your iOS app calls your backend, which calls Claude). With Firebase, you skip the "your backend" layer for most operations.

How it's different from Railway / AWS

Firebase Auth

Drop-in authentication. Supported sign-in methods in 2026:

Pricing: free up to ~50k monthly active users, then ~$0.015/MAU. For most indie iOS apps, Firebase Auth costs nothing for a long time.

Integration with iOS is genuinely two-line: import the SDK, call Auth.auth().signIn(...). Even with Claude assistance, you'll save several days vs rolling your own auth.

Firestore

Firestore is a serverless document database. Documents (JSON-like records) live inside collections; collections can be nested. You read/write from your iOS app using the SDK, with real-time subscription support — if a document changes anywhere in the world, every subscriber gets the update within milliseconds.

Strengths:

Weaknesses:

Pricing roughly: $0.06 per 100k reads, $0.18 per 100k writes, plus storage and egress. For early-stage apps, the daily free tier (50k reads, 20k writes, 1GB storage) covers a real amount of traffic.

Realtime Database (legacy, still used)

The original Firebase database product. Different from Firestore: simpler tree-of-JSON structure, different pricing (per-GB transferred, not per-operation), different query model. Mostly superseded by Firestore but still actively maintained. New projects should default to Firestore unless you have a specific reason.

Cloud Storage for Firebase

File storage. Powered by Google Cloud Storage under the hood, exposed through a Firebase SDK with security rules and authenticated access. Upload images, videos, user-generated content directly from the iOS app; downloads are also direct.

For an app like an RDR2 Companion, you probably don't need it. For any app with user uploads (profile pictures, attachments), it's the easiest path.

Firebase Cloud Messaging (FCM)

Push notifications. Free at any scale. Integration with APNs (Apple Push Notification service) is built in. Send a notification to a single user, a topic (all users subscribed to a topic), or a segment via the Firebase console or API.

For an iOS app, you still need an Apple Developer account, APNs key, and the right entitlements; FCM is the layer on top that gives you cross-platform send + segmentation + analytics. Even iOS-only apps often use FCM for the convenience.

Cloud Functions for Firebase

Server-side functions that run on Google's infrastructure, triggered by Firebase events (a document changes, a user signs up, a file uploads) or HTTP requests.

This is where the Claude API key lives in a Firebase-only architecture. Your iOS app calls a Cloud Function HTTP endpoint; the Cloud Function calls Claude with the secret key; the response goes back to the app. Same proxy pattern as Railway, just hosted on Google's serverless platform.

Cloud Functions support Node.js, Python, and a few other runtimes. Cold starts are real (~1-3 seconds on first call after idle) which can be a UX issue for AI calls; mitigate with minimum instance configuration if needed.

Firebase Hosting

Static site hosting with global CDN. Free tier covers ~10GB storage + 360MB/day transfer. Useful for: documentation sites, landing pages, web companion to a mobile app, web admin dashboard. Not relevant for iOS-only apps.

App Check — your iOS app's bouncer

One of Firebase's most under-promoted features. App Check verifies that requests to your Firebase services come from your real, unmodified iOS app — not from a scripted abuser using your API key.

On iOS, App Check uses Apple's App Attest framework. The phone proves to Apple's servers that it's a real device running your real app; Firebase trusts Apple's attestation; your services reject any request that doesn't carry a valid token.

Enable App Check before launching. It's free, low-overhead, and prevents the most common "someone scripted my API and ran up the Claude bill" attack.

Analytics, Crashlytics, A/B Testing, Remote Config

Where Claude / AI fits in a Firebase architecture

Firebase doesn't host third-party LLMs directly. The two real patterns:

  1. Cloud Functions as the Claude proxy. iOS calls a Cloud Function HTTP endpoint; the function calls the Anthropic API with the secret key; response returns. Same shape as a Railway backend, just on Google's serverless platform.
  2. Vertex AI integration. Cloud Functions can call Vertex AI (Gemini, or Claude via Vertex). Useful if you want a single Google billing relationship.

The Cloud Functions approach works but introduces cold-start latency. For UX-sensitive AI calls, a warm Railway/Cloud Run backend often delivers better first-token-time.

Pricing realities

Firebase's free tier (Spark plan) covers a meaningful amount of usage. The Blaze (pay-as-you-go) plan is required to use Cloud Functions or to exceed any individual service's free tier. Blaze is genuinely cheap at low volume but can spike fast:

Set a budget alert in the Firebase console. Monitor weekly.

The honest tradeoffs of going Firebase-first

Benefits:

Costs:

A starter Firebase stack for iOS

For a new consumer iOS app where you want to ship fast:

For your existing iOS work that already uses Railway, migrating to Firebase isn't necessary. Railway with a backend you control is a perfectly legitimate architecture. Firebase is the better choice when you're starting fresh and want minimum backend code.


See also: Backend Servers Explained, GCP Deep Dive, Railway Deep Dive.

Sources & References
  1. Firebase — Official documentation
  2. Firebase — App Check
  3. Apple — App Attest