Learn/Distributed CloudOpen SourceDigital Freedom

Firebase Alternative: What Changes When Your App's Database Lives on Your Own Devices

A local, distributed Firebase alternative commits each write on the device first, then syncs to replicas the user owns. No Google round trip, no per-user meter, no vendor copy.

Signed by Mยท
Three small external drives on a wooden living-room table beside a potted plant and a closed book
What is a local distributed Firebase alternative?

It is a database that finishes each write on the device in front of you and then syncs it to the other devices the same person owns, with no central server deciding which write wins. SpaceDB is MATA's version: local-first, CRDT-based, encrypted on every replica and free of any per-user cloud meter.

๐Ÿชฉ The Disco Party is MATA's distributed cloud, and SpaceDB is the database underneath it.

Firebase works by sending every change to Google first and fanning it out from there. Your app is exactly as alive as that round trip. A local, distributed Firebase alternative flips the order: the write is finished on the device in your hand, and the other devices you own catch up when they can.

SpaceDB is how MATA does it: local-first, CRDT-native, replicated across a mesh of your own machines, written in pure Rust. The problems with Firebase when the network drops explain why you would want this. This page is about what actually changes for a household once the database stops living in a rented region.

Starting From the Device, Not the Region

"Local" means a change is complete before the radio gets involved. The screen updates because the disk did, not because a data centre answered. "Distributed" means there are several copies and none of them is in charge. A phone, a laptop and a small box on the kitchen shelf can all hold the same family's shopping list, and when two of them edit it while apart, they merge without asking a server which edit counts.

That is the idea behind a distributed cloud: the cloud is the hardware people already own, and the Disco party is MATA's name for it. Firebase can still sit beside it for a workload that truly needs one authoritative region. It just should not be where a person's records live by default.

How It Behaves Day to Day

Three properties come from committing locally and replicating without a coordinator. They are easiest to understand as things you notice.

Saving Works With No Signal

Being offline is the normal case, and connectivity only adds syncing. Reads come from disk, so speed depends on the device, not the distance to a server. SpaceDB makes the state visible: every write returns the consistency it achieved, such as durable here and spreading outward, and reads report whether data is live, stale, unsynced or partitioned. An app built on it can tell you the truth instead of a spinner.

Edits Made Apart Come Back Together

With a central server, the copy in the data centre picks a winner and the other edit disappears. SpaceDB uses CRDTs instead: last-writer-wins registers, counters that add up correctly, collaborative text and sets, all with a fuzzed proof that replicas converge. Not every field wants the same rules, so each one chooses a tier. A reaction count can converge loosely, a cursor can guarantee you read your own writes, and a username can demand a quorum and refuse rather than duplicate. Moving those bytes between devices without a server is peer-to-peer sync over iroh.

The Owner Keeps the Keys

Each replica is encrypted with keys the user controls, so whoever carries the bytes never sees plaintext. If a phone is lost, the data survives on another replica, or as erasure-coded shards held by peers, which is the subject of erasure coding on the distributed cloud. The Electronic Frontier Foundation has long argued that a vendor keeping a copy "for convenience" is never neutral. Here, custody is something you can physically point at.

What Changes in the Product

The data model can look familiar. The bill, the outage and the legal exposure all change shape.

No Per-User Bill

Firebase charges for traffic through Google; a Firebase alternative running on the user's hardware has nothing to meter. When reads and writes happen on the user's own hardware, hosting cost no longer grows with each person who opens the app. Growth stops being an invoice event, which is the economic floor the Freedom Guide is built on. The library itself is MIT or Apache-2.0 and depends on nothing proprietary.

Access Is a Signed Grant

Nobody logs in and then reads everything. A caller, human or AI agent, presents a capability: signed by the owner, scoped to a collection and a set of operations, with an expiry and even a spending budget. Revoking access kills the grant instead of requiring a password reset at a vendor, and an audit log records what each grant did. Capability tokens apply the same pattern across the mesh. The Privacy Rights Clearinghouse catalogues what happens when broad, long-lived access leaks instead.

Where SpaceDB Fits and Where It Does Not

Use it when the data belongs to a person who has more than one device: notes, lists, photos metadata, family calendars. Keep a rented primary for workloads that genuinely need one authoritative region. The source is in the SpaceDB repository, with a card on remadewithrust.com. Fetching files by content hash rather than a bucket URL is covered in content-addressed storage. A Firebase alternative built this way is less a product swap than a change of address for your data.

FAQ

Short answers already in this article.

Does the app wait for the network before saving a change?

No. The write lands on the local disk and the screen updates from there. SpaceDB reports what each write achieved, for example Outcome::Local for durable on this device and converging outward, so the app can show that honestly.

How are edits made on two disconnected devices combined?

With conflict-free replicated data types. Registers, counters, collaborative text and sets each have merge rules, so replicas that diverged converge on the same state when they reconnect, and neither edit is dropped.

Can some fields still require a single agreed value?

Yes. Each field picks a tier: convergent, causal or strong. Strong fields, such as a unique username, go through a quorum and return Unavailable rather than committing two conflicting values while devices are apart.

Who holds the keys to the replicated data?

The user. Every replica is encrypted, so a peer or relay carrying the bytes never gets plaintext. Losing one device loses nothing if another replica or a set of erasure-coded shards survives.

Is SpaceDB free to use for a household app?

The library is open source under MIT or Apache-2.0 and depends on nothing proprietary, so embedding it and syncing your own replicas costs nothing. MATA's disco network is the paid option for reaching devices you do not own.