Skip to content
BarqDBPublic

About

Native C++ core for BarqDB: embedded object storage, live queries, HNSW vector search, and sync foundations behind every BarqDB SDK.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Barq Core

License Status C++17

The native core of BarqDB — a local-first database with real-time sync. It holds the storage engine, object store, query system, C API, and sync foundation shared by every Barq SDK.

Use an SDK

Barq Core is a building block, not an end-user product — it has no publicly stable API. To build an app, use one of the SDKs, which embed this core:

SDK Platform
barq-js JavaScript, React Native
barq-kotlin Kotlin Multiplatform — Android, iOS, JVM
barq-swift Swift, Objective-C
barq-native C++

What's inside

Path Contents
src/barq storage engine, query engine, object store, sync client, C API, tools
src/barq/sync/noinst/server sync server library and optional server executable
src/external vendored third-party code
test storage, sync, object-store, and C API tests

Build

Barq Core builds with CMake and C++17.

cmake -S . -B build
cmake --build build

Sync server

Build the optional server executable:

cmake -S . -B build -DBARQ_BUILD_SERVER=ON
cmake --build build --target BarqSyncServer

Run it with a data directory and the public key it uses to verify client JWTs (the binary is under build/src/barq/sync/noinst/server/; debug builds append -dbg):

barq-server \
  --root-dir ./barq-sync-data \
  --jwt-public-key ./public.pem \
  --host 127.0.0.1 --port 9090

Add --tls-cert and --tls-key for TLS. --allow-unsigned-tokens skips signature checks for local testing only — production clients should send signed JWTs, and token signing belongs in your auth service, not in this library.

Point a client at the server through its configurable route:

barq_sync_manager_set_route(manager, "wss://your-server/barq-sync", true);
barq_sync_config_t* config = barq_sync_config_new(user, "partition");

Test

cmake --build build --target SyncTests
cmake --build build --target ObjectStoreTests

The test binaries (barq-sync-tests, barq-object-store-tests) are written under build/test/.

License and attribution

Barq Core is a modified fork of Realm Core, licensed under the Apache License 2.0. The original Realm Inc. copyright headers are retained in every file they came from; see the Git history for what changed. Third-party notices are listed in THIRD-PARTY-NOTICES.

Barq is an independent project. It is not affiliated with, sponsored by, or endorsed by Realm, MongoDB, Inc., or MongoDB Atlas. "Realm", "MongoDB", and "MongoDB Atlas" are trademarks of MongoDB, Inc.

About

Native C++ core for BarqDB: embedded object storage, live queries, HNSW vector search, and sync foundations behind every BarqDB SDK.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages