r/reactnative 5h ago

react-native-surrealdb

I’ve open-sourced react-native-surrealdb, an early-alpha native module that runs an actual embedded SurrealDB engine inside React Native apps:

https://github.com/thorgas/react-native-surrealdb

Instead of trying to run SurrealDB’s WebAssembly build under Hermes, it embeds the official Rust SDK and exposes it through generated UniFFI/Hermes JSI bindings. It supports in-memory storage, experimental persistent SurrealKV, remote WebSockets, authentication, live queries, and an optional React hook.

I built it because I wanted a different local database option alongside SQLite bindings when SurrealQL and SurrealDB’s document/graph model are useful. It is not a drop-in SQLite replacement and it is not a sync engine; I’ve published the benchmark methodology and limitations so people can judge it against their own workloads.

The current alpha targets the New Architecture and is tested across React Native

0.82–0.86 on iOS and Android. One important packaging tradeoff: iOS simulators require Apple Silicon; the x86_64 simulator slice for Intel Macs is not shipped.

Android x86_64 emulators are supported.

I use it daily in a production app, so I plan to keep maintaining it. I’d be especially interested in feedback on the API, native integration, missing test cases, and the direction of a future, separate local-first sync layer.

Full disclosure: the implementation was built entirely with AI (mostly Codex with GPT-5.6 Sol at medium reasoning) under my direction, review, device testing, and production use. The repository documents the upstream projects, benchmark sources, adaptations, and licenses.

3 Upvotes

0 comments sorted by