Learn/Distributed CloudOpen SourceDigital Freedom

Challenges of Firebase: What Happens to Your App When the Network Drops

Firebase works beautifully on good Wi-Fi. On a train, in a basement, or for data that belongs to the user, its cloud-first design, custody model and metered pricing start to show.

Signed by M·
A dark smartphone with the screen off lying on a blue subway seat, tunnel light blurred past the window
What goes wrong with a Firebase app when the network drops?

Firebase treats the copy on Google's servers as the source of truth. Its client caches can keep an app usable for a while, but the authoritative write, the security rules and the bill all live with the vendor. For records that belong to a person, a local-first database such as SpaceDB commits on the device first.

Picture a shared family shopping list or a group chat built on Firebase. On home Wi-Fi it is lovely: changes appear instantly on everyone's phone, and the developer never had to write a backend. Then someone opens it on the underground, in a lift, or in a basement storeroom. Sometimes it carries on from its cache. Sometimes it shows a spinner, or a list that is quietly out of date, and the person decides the app is broken.

None of the challenges of Firebase are missing console features. They come from three design choices: the copy on Google's servers is the one that counts, Google is the custodian of the records, and the bill grows with use. Those choices are sensible for many apps. They become painful when the network is unreliable and the data belongs to the person holding the phone. This page is the diagnosis; SpaceDB, the local-first Firebase alternative is the comparison, and the local distributed Firebase alternative covers the benefits of the other approach.

The Server Copy Is the One That Counts

Firebase Realtime Database and Cloud Firestore are excellent at one shape: mobile clients, fan-out through Google's servers, and a developer who wants no backend. In that shape the authoritative write happens on the server. The client SDKs soften this. According to Google's own documentation, Firestore's offline persistence is enabled by default on Android and Apple platforms and disabled by default on the web, so a cached app can keep reading and queue writes. But queued writes are provisional until the server accepts them, security rules are evaluated there, and any conflict is resolved there.

A mesh starts from the opposite end. In what a distributed cloud is, the device in your hand is already a full machine, and the Disco Party, MATA's distributed cloud, is a set of such machines. A database that cannot finalize a change until a data center answers is not a natural fit for that party.

Three Strains That Build Over Time

The spinner is the failure people see. The other two arrive in the terms of service and the invoice, and they tend to bite in the year the app succeeds.

Connectivity as an Assumption

Everyday life includes trains, lifts, aircraft and rural dead spots. When the path to the vendor drops, a cloud-first app either works from a cache of uncertain age or waits. This is architectural rather than a bug in the SDK: the source of truth is a machine you do not hold. The NIST Zero Trust Architecture treats every device as its own boundary and assumes any single network path can vanish. Peer-to-peer device sync is what happens when two phones in the same room can talk directly instead of each asking a distant server.

Google as the Custodian

Storing records on a provider's servers is a custody decision, not a hosting detail. Firebase data is encrypted at rest, but with keys the operator manages, so the operator can be asked for it. The EFF has documented for years what follows from that arrangement: legal demands, retention policies and copies nobody meant to keep. In MATA's terms of Trust, Security and Incentive, custody of the records is the Trust half, and a database that is the custodian cannot also be the user's.

A Meter on Success

Cloud Firestore pricing is based on document reads, writes and deletes plus storage, and Realtime Database charges for data stored and downloaded. Growth therefore arrives as a larger invoice, and a screen that re-reads a long list on every open can cost more than the feature is worth. The FTC's competition work has examined how cloud business practices shape markets. For a household app the plainer point is that being opened often should not be a cost problem.

Choosing What to Move

You do not have to abandon every cloud database. The useful question is which records the user owns and expects to open anywhere.

Keep Firebase Where It Shines

A leaderboard, a presence dot, a prototype you will throw away: these are shared, disposable, and fine to keep on Firebase. The challenges of Firebase sharpen when the data is messages, files, health notes or money, and the app has to open when the radio does not. Name the workload before you pick the SDK. The Remade with Rust catalog lists the pieces for a stack that does not start from a rented primary database.

Commit on the Device First

SpaceDB writes each change to the device first, then lets replicas converge whenever they can see each other. It uses CRDTs with per-field consistency, grants access through capabilities rather than an ambient session, and has no per-user meter. The family shopping list then works in the lift and merges cleanly in the kitchen. The Freedom Guide is how a person gets onto the mesh that carries those replicas.

Plan the Migration

Treat the challenges of Firebase as the brief and design the schema around ownership: which fields are personal, which are shared, and who may grant access to each. The build details are on the SpaceDB page. If tunnels and basements are part of your users' day, the spinner is not a passing glitch; it is the architecture telling you where the source of truth lives. Browse related pieces in Learn.

FAQ

Short answers already in this article.

Does Firestore work offline at all?

Partly. Firestore's offline persistence is on by default in the Android and Apple SDKs and off by default on the web, so a cached app can keep reading and queue writes. The server copy is still the one that counts, and conflicts are settled there when the device reconnects.

Who can read the data in a Firebase project?

The project owner and Google as the operator. Data is encrypted at rest, but with keys Google manages, so custody stays with the vendor. That is a reasonable trade for a scoreboard and a harder one for a family's messages or health notes.

How does Firebase pricing change as an app grows?

Cloud Firestore bills per document read, write and delete plus storage, and Realtime Database bills for data stored and downloaded. A popular app is a larger invoice, and a chatty screen that re-reads lists can cost more than its feature is worth.

When is Firebase still the right choice?

For data that is naturally shared and disposable: a leaderboard, a presence indicator, a prototype you will throw away. It is weaker for records the user owns and expects to open anywhere, such as messages, files, health or money.

What does SpaceDB do differently?

SpaceDB commits each change on the device first and lets replicas converge when they can reach each other, using CRDTs with per-field consistency. Access is granted by capabilities rather than an ambient login session, and there is no per-user meter.