DocsGet StartedComparison

Comparison

How TopGun compares to other solutions in the ecosystem.

FeatureTopGunFirebaseSupabase RealtimeYjsRxDBReplicacheInstantDB
Primary ModelLocal-First CRDT gridCloud Doc DBPostgres pub/subCollaborative CRDT frameworkLocal-First DBClient-auth syncLocal-first graph DB
Offline SupportFirst-ClassGoodLimitedExcellentExcellentGoodFirst-Class
Latency~0ms (in-memory)Network-dependentNetwork-dependent~0ms (in-memory)~5–10ms (IndexedDB)~0ms local / server-validated~0ms (in-memory)
Backend ControlSelf-host (Apache-2.0)ProprietarySelf-host or Supabase CloudBYO transport / providerCouchDB / CustomSelf-host or Replicache CloudInstantDB Cloud (self-host community)
ConsistencyHLC + CRDTServer-authoritative LWWServer AuthorityCRDT (Y-types)Revision TreesServer AuthorityServer-authoritative with optimistic UI
Distributed LocksFencing Tokens (single-node stable; cluster Raft: in progress)Not SupportedNot SupportedNot SupportedNot SupportedNot SupportedNot Supported
LicenseApache-2.0ProprietaryApache-2.0MITApache-2.0 / Proprietary (Premium)Apache-2.0MIT (client) + proprietary cloud

Distributed Locks — Deployment Mode Semantics

Distributed locks in cluster mode currently use partition-routing without Raft consensus. They are safe for deployments where a single node owns the relevant partition, but provide weaker guarantees under split-brain. Raft-backed cluster locks are in development.

Why TopGun?

  • vs Firebase:

    TopGun gives you ownership of your data. Run it on your own cloud, use your own backend, and never get locked into a proprietary platform.

  • vs Supabase Realtime:

    Supabase Realtime is Postgres pub/sub — great for server-driven events, but not designed for offline-first local writes. TopGun persists data locally in IndexedDB and syncs seamlessly when the network returns.

  • vs Yjs:

    Yjs is an excellent CRDT framework for collaborative text editing but requires you to bring your own transport, persistence, and server. TopGun ships with a full server, IndexedDB persistence, and a React SDK out of the box.

  • vs RxDB:

    RxDB is a mature local-first database with good offline support, but its writes go through IndexedDB (5–10ms). TopGun operates entirely in-memory for zero-latency reads/writes, with async write-behind to the configured backend.

  • vs Replicache:

    TopGun uses CRDTs for automatic conflict resolution — mutations apply locally first and merge deterministically. Replicache is server-authoritative: mutations queue and the server validates them. Related: Zero (also from Rocicorp) offers a similar server-authoritative model with a managed cloud option. Both Replicache and TopGun are Apache-2.0 open source.

  • vs InstantDB:

    InstantDB is a local-first graph database with an excellent developer experience. It currently runs on InstantDB Cloud (community-led self-hosting available via the open-source repo). TopGun is fully self-hostable under Apache-2.0 with no cloud dependency.