ankur-anand/unisondb
A streaming multimodal database for Edge AI, and Edge Computing.
UnisonDB – A Log‑Native Real‑Time Database for Edge AI
What it is – UnisonDB is an open‑source, multi‑model database written in Go that treats its write‑ahead log (WAL) as the primary data source. Every write is persisted to a B+‑Tree store and streamed instantly to any number of replicas via gRPC or object‑store (S3/MinIO/GCS/Azure) backed replication. The design targets edge‑first workloads where data must stay close to the compute that uses it and where thousands of nodes need sub‑second update propagation.
Core ideas
| Idea | Why it matters |
|---|---|
| Log‑native | The WAL is the source of truth; reads can query the B+‑Tree while the same log is streamed to replicas, eliminating the need for separate CDC or message‑bus pipelines. |
| Streaming fan‑out | A primary can push WAL segments to 100+ edge nodes in a few hundred milliseconds, and those nodes can further relay to more nodes, enabling massive, low‑latency fan‑out without Kafka‑style brokers. |
| Blob‑backed replication | Replicas can poll immutable WAL segment files from any object store, so you don’t need a permanent gRPC connection for every edge node. |
| Multi‑model storage | Supports simple key‑value, wide‑column (partial column updates), and large‑object (LOB) APIs on top of the same engine. |
| Zero‑MQ change notifications | Side‑car notifications give sub‑millisecond alerts when data changes, enabling reactive edge services. |
Architecture at a glance
+---------------------------+ +---------------------------+
| Multi‑Model API Layer | | Replication Layer |
| (KV, Wide‑Column, LOB, Tx) | | WAL streaming (gRPC / S3) |
+---------------------------+ +---------------------------+
| Engine Layer |
| • MemTable (skip‑list) |
| • B+Tree store (BoltDB/LMDB) |
+---------------------------+
| WALFS (Write‑Ahead Log FS) |
| • Memory‑mapped, segmented log
| • Random‑access reads for followers
+---------------------------+
| Disk (persistent files) |
+---------------------------+
- WALFS – a mmap‑based, segmented log that can be iterated forward, seeked to an exact offset, or tail‑followed for real‑time replication.
- Engine – writes go to the WAL, then to an in‑memory MemTable; reads are served from the B+‑Tree index.
- Replication – followers track a
(segmentID, offset)cursor, pull new records via gRPC streams or by downloading the next WAL segment from object storage, and apply them locally.
Key features (as listed in the repo)
- Streaming fan‑out & ISR replication – instant, ordered propagation to many readers.
- Blob fan‑out – publish WAL once to object storage; unlimited readers can poll.
- Multi‑modal storage – KV, wide‑column, and large objects.
- Zero‑MQ change notifications – sub‑ms latency alerts.
- Durable B+‑Tree engine – optional back‑ends: BoltDB (single‑file) or LMDB (memory‑mapped).
- Namespace isolation – multi‑tenant support.
- Atomic multi‑key transactions – all‑or‑nothing writes.
- Edge‑first design – low‑resource footprint, optimized for local‑first deployments.
Typical use cases
- Edge AI inference pipelines – keep model parameters and inference results locally, replicate updates instantly to fleets of devices.
- Real‑time dashboards – UI components subscribe to Zero‑MQ notifications and read the latest state without a separate streaming system.
- Distributed sensor networks – sensors write to a local primary; thousands of downstream nodes receive the same log via S3‑backed replication.
- Hybrid cloud‑edge deployments – primary runs in a data center, edge replicas pull WAL segments from the same object store, staying consistent even when offline.
Performance highlights from the README
- Throughput: 60 k–80 k
SETops / sec (1 KB values) on an Apple M2 Pro while fan‑out to >10 k nodes. - Latency: sub‑millisecond change notifications; replication latency measured in the low‑hundreds of ms for 100‑node fan‑out.
- Benchmarks: Redis‑compatible benchmark shows UnisonDB comparable or better than BadgerDB, BoltDB, and LMDB for mixed
SET/GETworkloads.
Getting started (quick steps from the README)
# clone & build
git clone https://github.com/ankur-anand/unisondb && cd unisondb
go build -o unisondb ./cmd/unisondb
# start a primary server
./unisondb server --config config.toml
# simple HTTP API test
curl -X PUT http://localhost:4000/api/v1/default/kv/mykey \
-H "Content-Type: application/json" \
-d '{"value":"bXl2YWx1ZQ=="}'
Project status
- Alpha – early‑stage but functional; CI badges show test coverage and build health.
- Roadmap – linked wiki outlines upcoming features (e.g., more storage back‑ends, tighter security, richer query language).
Bottom line
UnisonDB bundles durable storage, real‑time streaming, and edge‑optimized replication into a single Go‑based engine. For teams building AI or IoT workloads that need local‑first data with instant fan‑out to thousands of nodes, it offers a unified alternative to the traditional stack of a database + message broker + CDC pipeline.
Related
- Project
- Project
- Project
- Project
- Project