What is Ankurah?
Ankurah is a real-time reactive database for building collaborative and multiplayer applications. Define your data model once in Rust, and use it everywhere—native servers, browser clients, mobile apps—with automatic synchronization across all connected nodes.
The Challenge
Building applications where multiple users interact with shared state is hard. You need real-time sync, offline support, conflict resolution, reactive UI updates, and query pushdown—and it all has to work consistently across your server (Postgres) and clients (IndexedDB in browsers). Most teams either build fragile ad-hoc solutions or accept significant compromises.
The Approach
Ankurah is event-sourced: every change is an operation that can be replayed, merged, and synchronized. Entities can reference each other (graph-style navigation), and you can subscribe to live queries that automatically update as data changes anywhere in the system.
Your model is defined once in Rust with a derive macro. The same code compiles to native binaries for servers and WASM for browsers. TypeScript interfaces and React hooks are generated automatically.
Why Ankurah?
Local-first by default. Your queries execute against the local cache instantly, then sync with durable servers in the background. Users get sub-millisecond reads and offline support without you writing sync logic.
Live queries that just work. Subscribe to a query and your UI stays in sync automatically—changes flow in from anywhere.
Graph-ready data model. Entities can reference each other, and you can navigate those relationships directly in queries. Full graph traversal is on the roadmap.
Collaborative editing built in. Text fields can use Yjs-backed CRDTs for real-time collaborative editing with automatic conflict resolution.
One codebase, multiple backends. Swap between Sled, SQLite, Postgres, and IndexedDB without changing application code. Your server uses Postgres while browsers use IndexedDB—same queries, same models.
Who it's for
Teams building collaborative tools, local-first apps, multiplayer experiences, or anything where users interact with shared state in real-time.
Key Features
1️⃣ Schema-First Design
YrsString is default backend for String, LWW otherwise
🔍 Live Queries
Rust
TypeScript
Views and WASM bindings generated by the Model macro
⚛️ React Support
ReactObserver tracks livequery.items
🗄️ Flexible Storage
Sled
Postgres
SQLite
IndexedDB
TiKV planned
⚡ Generated Interfaces
export class Album {
static query(context: Context, selection: string, ...args: any): AlbumLiveQuery;
...
}
🔋 Batteries Included
WebSocket server & client • HTTP/REST endpoints • Authentication hooks • Query routing & pushdown
Quick Example
Server
Rust Client
WASM Client
React Component
Getting Started
Get up and running quickly with our React + Sled template:
Or run the example manually:
# Start the server
# Build WASM bindings (in examples/wasm-bindings)
# Run the React app (in examples/react-app)
&&
Then open http://localhost:5173/ in two browser tabs (one regular, one incognito) to see real-time sync.
Core Concepts
| Concept | Description |
|---|---|
| Model | A struct describing fields and types for entities in a collection |
| Collection | A group of entities of the same type (like a database table) |
| Entity | A discrete identity in a collection with dynamic schema |
| View | A read-only, typed representation of an entity |
| Mutable | A mutable, typed state representation of an entity |
| Event | An atomic change used for synchronization and audit trail |
Roadmap
Milestone 2 - TiKV backend, Graph functionality, User-definable data types
Milestone 3 - P2P, Portable cryptographic identities, E2EE, Hypergraph