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
- No server code by default. Auth, database, storage, push — all SDK calls from the app.
- Client-side rules. Security is enforced by Firebase Security Rules (a declarative language) rather than by your backend code.
- SDK-driven. Heavy SDK in your app vs lightweight HTTPS calls.
- Cloud Functions for the cases where you do need server code (e.g., calling Claude securely — SDK from iOS would expose the API key).
- Pricing scales differently. Per-operation, per-read, per-write — can be cheap or surprisingly expensive depending on usage patterns.
Firebase Auth
Drop-in authentication. Supported sign-in methods in 2026:
- Email/password
- Email link (magic link)
- Phone number (SMS)
- Google Sign In
- Apple Sign In (required for iOS apps that offer other social logins)
- Facebook, Microsoft, Twitter/X, GitHub, Yahoo
- Anonymous (lets users use the app without an account, then optionally upgrade later)
- Custom auth (for SSO with enterprise identity providers)
- OpenID Connect / SAML (enterprise)
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:
- Real-time sync built in.
- Offline support — the SDK caches data locally and replays writes when reconnected.
- Scales massively without ops work.
- Security Rules let you declare "users can only read documents where ownerId matches their UID" in a few lines.
Weaknesses:
- Query model is more limited than SQL. Complex joins and aggregations are awkward.
- Per-read pricing can surprise you. A poorly-modeled feed query that reads 1,000 documents per user load gets expensive at scale.
- No transactional cross-collection consistency in the way a relational DB offers.
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
- Firebase Analytics (Google Analytics for Firebase) — free, scales well. Track events, user properties, funnels. Less privacy-respectful than Plausible/PostHog; consider the tradeoff.
- Crashlytics — free crash reporting for iOS. Symbolicated stack traces, grouping, real-time alerts. Essential.
- A/B Testing — run experiments on features, monitor results.
- Remote Config — change values in your iOS app from the Firebase console without an app update. Useful for feature flags, copy tweaks, gradual rollouts.
Where Claude / AI fits in a Firebase architecture
Firebase doesn't host third-party LLMs directly. The two real patterns:
- 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.
- 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:
- Cold starts burn function execution time.
- Aggressive Firestore listeners on a busy app can read millions of documents.
- Egress to users (especially video / large file downloads) priced per GB.
- Auth at large MAU — ~$0.015/MAU adds up.
Set a budget alert in the Firebase console. Monitor weekly.
The honest tradeoffs of going Firebase-first
Benefits:
- Ship a real backend in days, not weeks.
- Real-time sync, offline support, file storage, auth, push — all out of the box.
- Free tier covers early traction.
- Massive scalability without ops.
Costs:
- Vendor lock-in. Firestore queries don't translate to other databases without rework.
- Cost surprises at scale.
- Limited query model — complex business logic is awkward.
- Cold starts for Cloud Functions affect first-call UX.
- Cross-collection consistency is harder than in relational DBs.
- Less control over the underlying infrastructure.
A starter Firebase stack for iOS
For a new consumer iOS app where you want to ship fast:
- Auth: Firebase Auth (Apple Sign In + email).
- Database: Firestore with Security Rules.
- Storage: Cloud Storage for Firebase (if you have user uploads).
- Push: Firebase Cloud Messaging.
- Server logic / Claude proxy: Cloud Functions.
- Abuse prevention: App Check.
- Crash reporting: Crashlytics.
- Feature flags: Remote Config.
- Analytics: Firebase Analytics or PostHog/Plausible if privacy matters more.
- Budget alert on day one.
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.
- Firebase — Official documentation
- Firebase — App Check
- Apple — App Attest