Stream. Process. Store. One Engine.
Liven is a database built for data that moves. It ingests streaming data, transforms it on the fly, and stores it durably — all with a single pipeline query language. One binary.
# Install via crates.io
# One-liner install (Linux & macOS)
|
# Install via Docker
# Launch the server
Why Liven?
Databases today make you choose: batch or stream? Historical or real-time? Key-value or vector? Liven was built to erase those lines.
One query language, two modes:
- Historical queries against stored data
- Real-time subscriptions on the same pipeline — just add
.listen()
One engine, three deployment models:
- Embedded library (~1.5 MB) — runs inside your Rust process
- Network server — TCP + WebSocket, thousands of clients
- Interactive TUI or web dashboard — for ad-hoc queries and monitoring
Built-in capabilities that usually require separate systems:
- Vector similarity search (int8 quantized, cosine similarity)
- Stream joins (time-bounded correlate, multi-hop chain)
- Event pattern detection (sequence FSM)
- Time-windowed aggregations
- Full-text substring matching
Quick Start
# Launch the server
# → Open http://localhost:43120
# → Admin auth key printed on first start — save it
# Insert and query
# Live subscription
Embedded in Rust
Add the dependency with the features you need:
[]
= "0.0.3"
For a minimal embedded build with no server, TUI, or TLS:
[]
= { = "0.0.3", = false }
Rust Crate API
Liven provides two usage modes via the same unified method signatures:
| Mode | Initialization | Runtime |
|---|---|---|
| Embedded | Liven::open("./data")? |
In-process, no server needed |
| Wire | LivenClient::connect("127.0.0.1:43121").await? |
Remote server over TCP |
Both modes expose the same methods (insert, get, filter, enrich, etc.) —
the embedded versions are synchronous, the wire versions are async.
use Liven;
use LivenClient;
use ;
use json;
// ── Embedded ──
let db = open?;
db.insert?;
let results = db.run?;
// ── Wire (async) ──
let mut client = connect.await?;
client.insert.await?;
let results = client.run.await?;
Tip: Use
db.query("...")for ad-hoc string queries anddb.insert(...)/db.get(...)etc. for the typed API. Both work identically in embedded mode and over the wire.
Connection URL
The wire client supports connection URLs with optional auth key:
// Plain TCP
connect.await?;
// With auth key in URL
connect.await?;
CRUD operations
// ── Embedded ── // ── Wire (async) ──
db.insert?;
// client.insert("users", "u1", json!(...)).await?;
db.upsert?;
db.update?;
db.get?;
db.delete?;
db.clear?;
db.drop_stream?;
db.insert_many?;
db.upsert_many?;
// Metadata
db.streams?;
db.status?;
Pipeline operations
use ;
use AggregateStrategy;
// ── Embedded ── // ── Wire (async) ──
db.filter?; // ).await?;
db.limit?; // client.limit("events", 10).await?;
db.count?; // client.count("events").await?;
db.sort?; // client.sort("events","timestamp",true).await?;
db.page?; // client.page("events", 1, 50).await?;
db.map?;
db.window?;
db.group?;
db.distinct?;
db.page_cursor?;
// Vector similarity
db.vector_filter?;
// Stream joins
db.enrich?;
db.correlate?;
db.chain?;
db.sequence?;
Pipeline builder (for complex chains)
When you need multiple stages, use the builder and execute with db.run():
use ;
let pipeline = from
.filter
.filter
.sort
.limit;
// Embedded
db.run?;
// Wire
client.run.await?;
Pipeline update / delete
let pipeline = from
.filter;
// Update all matching records
db.pipeline_update?;
// Delete all matching records
db.pipeline_delete?;
Explain
use Query as Q;
let plan = db.explain?;
Real-time subscriptions
use ;
// Blocking subscription (embedded, non-async)
loop
// Async subscription (embedded)
let mut rx = db.subscribe;
spawn;
// Wire streaming (client)
use StreamExt;
let mut stream = client.listen.await?;
while let Some = stream.next.await
Custom configuration
use ;
let config = LivenConfig ;
let db = open_with_config?;
Full example
use Liven;
use ;
use json;
How It Works (at a glance)
flowchart LR
Client -->|query / subscribe| Query[Pipeline Query<br/>Engine]
Query -->|write| Storage[Append-Only<br/>Storage]
Query -->|read| Index[In-Memory Index]
Storage -->|flusher updates| Index
Index -->|point lookup| Query
Index -->|broadcast| Subscriber[Live Subscribers]
- Writes are appended to segment files. A background flusher batches them for throughput without sacrificing durability.
- Reads go through a lock-free in-memory index. Point lookups resolve in microseconds.
- Subscriptions broadcast every write to all listeners. The server evaluates pipeline filters before delivery.
- Compaction reclaims space from deleted records automatically.
- Recovery replays segments on startup. Checksums catch corruption.
Installation
From crates.io
From source
Before building with the
serverfeature, build the Web UI first:&& && &&Or skip the dashboard entirely:
cargo build --no-default-features
Docker
Package managers
| Platform | Format | Command |
|---|---|---|
| Debian/Ubuntu | .deb |
cargo deb --no-build -p liven |
| Fedora/RHEL | .rpm |
cargo generate-rpm --no-build -p liven |
| macOS | .dmg / .tar.gz |
See RELEASE.md |
| Windows | .msi / .zip |
See RELEASE.md |
Pre-built packages for each platform are available on the GitHub Releases page.
Logs
Liven logs to stdout/stderr. View logs based on your platform:
| Platform | Command |
|---|---|
| Linux (systemd) | sudo journalctl -u liven -f |
| Linux (manual) | liven start > liven.log 2>&1 |
| macOS (launchd) | tail -f /usr/local/var/log/liven/stdout.log |
| macOS (manual) | liven start > liven.log 2>&1 |
| Windows | liven.exe start > liven.log 2>&1 |
Advanced: Set RUST_LOG=debug or RUST_LOG=trace for verbose output.
Security
Auth-key mode (default)
Symmetric keys with BLAKE3 hashing. Four role levels:
| Role | Read | Insert | Delete | Admin |
|---|---|---|---|---|
read-only |
✅ | ❌ | ❌ | ❌ |
write |
✅ | ✅ | ❌ | ❌ |
write-delete |
✅ | ✅ | ✅ | ❌ |
admin |
✅ | ✅ | ✅ | ✅ |
Keys can be generated, revoked, and role-changed at runtime via the Web UI or REST API — no server restart required.
mTLS / ZTNA
Mutual TLS with X.509 certificates. Client CN maps to capabilities. Single-port mode multiplexes cleartext and TLS on the same listener.
Master key
Stored in ./liven.key (mode 0600). Override with LIVEN_SECURITY_MASTER_KEY environment variable.
Feature flags
Liven uses Cargo feature flags for modular builds.
The default feature enables everything by pulling in full, which bundles all three optional capabilities.
| Feature | What's included |
|---|---|
full |
All features below (enabled by default) |
server |
REST API + WebSocket + embedded Web UI |
tui |
Interactive terminal dashboard |
tls |
mTLS support with X.509 certificates |
# Minimal embedded build (no server, no TUI, no TLS)
# Embedded with TLS support
Licensing
SSPL 1.0 OR Commercial
- SSPL — Free for self-hosting, development, and personal use.
- Commercial — Required for managed services or proprietary embedding.
Contact team@livendb.com for commercial licensing.
Contributing
Contributions are welcome! See CONTRIBUTING.md for guidelines on submitting pull requests, code style, and development setup.
All contributors are expected to follow our Code of Conduct.