What is Barq?
Barq is a local-first object database.
Apps read and write a local database file. The app keeps working offline. If sync is enabled, Barq sends local changes to a Barq sync server and pulls remote changes back down.
Main Idea
Section titled “Main Idea”Barq is built for apps that need fast local data and optional sync.
Use Barq when you want:
- Local reads and writes first.
- Object models instead of hand-written SQL rows.
- Live queries and change listeners.
- Sync that can be pointed at your own Barq server.
- Tenant-based isolation with signed tokens.
Project Parts
Section titled “Project Parts”| Part | Path | Purpose |
|---|---|---|
| Core | core/ |
Storage, object store, query engine, sync client, and sync server. |
| Native SDK | native/ |
C++ SDK built on Barq Core. |
| JavaScript SDK | client/barq-js/ |
JS and React Native packages. |
| Kotlin SDK | client/barq-kotlin/ |
Kotlin client work. |
| Examples | example/ |
Native demos and sync end-to-end checks. |
Sync Model
Section titled “Sync Model”Barq does not own your auth system.
Your app gets a signed access token from your identity provider. The client creates a Barq sync user from that token. The server verifies the token and uses the token claims to decide tenant and identity.
For multi-tenant sync, the tenant comes from the verified token. The client does not get to choose another tenant path.
Fork Note
Section titled “Fork Note”Barq is an independent project derived from Realm projects. It is not affiliated with Realm, MongoDB, or MongoDB Atlas.