skaidb is a schema-less, SQL-speaking, leaderless distributed database written in Rust. It stores dynamically-typed documents and queries them with a subset of SQL:2016 core.
One binary gives you LSM storage, leaderless replication with tunable quorums, secondary and global indexes, full-text and vector search, geo queries, time-series tables, and a native MQTT broker — behind a binary fast path, with a REST gateway and a PostgreSQL-protocol port alongside.
The same engine also runs inside an application: as an Android library with a Kotlin API, and as an in-process library with a C ABI.
skaidb also ships as a library. On Android the engine is a native library in your APK and the database is a directory in your app's private storage; nothing listens on a socket. It is the same SQL, the same types and the same on-disk format as the server — a local store your app owns, not a member of a cluster.
// Kotlin — org.skaidb:skaidb-android-kotlin val db = SkaidbDatabase.open( directory = File(context.noBackupFilesDir, "store"), options = OpenOptions(key = storeKey), // 32 bytes, or null for a plain store ) db.execute("CREATE TABLE IF NOT EXISTS messages (PRIMARY KEY (channel, ts))") db.update( "INSERT INTO messages (channel, ts, sender, body) VALUES (?, ?, ?, ?)", "C1", "1700000000.000100", "U7", "hello", ) // a Flow: the current rows, then again whenever a write changed them db.observe( "SELECT ts, sender, body FROM messages WHERE channel = ? ORDER BY ts DESC LIMIT 200", channel, ).collect { rows -> render(rows) }
skaidb-android-kotlin gives suspending calls and Flow queries; skaidb-android-core is a blocking API for Java and Kotlin. Android 11 (API 30) and newer, on arm64-v8a, armeabi-v7a, x86_64 and x86.
Pass a 32-byte key and every table file, index file and write-ahead log is sealed. A missing or wrong key is refused before any data is read. A killed process loses no acknowledged write.
libskaidb_embedded, static and shared, with one header; prebuilt for Linux x86_64 and aarch64. An unencrypted store's directory is a server data directory: skaidbsh --local opens it.
The library never connects anywhere: no network and no replication. Moving data between a device and a server is the application's job. Full-text search is not part of the Android library; time-series tables, vector indexes and geo indexes are off there unless the open asks for them.
Signed packages for Debian/Ubuntu on amd64 and arm64, straight from the package repository. Each package ships the skaidb server and the skaidbsh shell.
# Add the signed apt repository (Debian / Ubuntu)
curl -fsSL https://repo.dsys.org/pubkey.gpg \
| sudo tee /etc/apt/keyrings/repo-dsys.gpg > /dev/null
echo "deb [signed-by=/etc/apt/keyrings/repo-dsys.gpg] https://repo.dsys.org/deb stable main" \
| sudo tee /etc/apt/sources.list.d/repo-dsys.list
sudo apt update && sudo apt install skaidb
skaidb --data-dir ./data --bind-addr 127.0.0.1 \
--quic-port 7000 --rest-port 7080
# every option is also a CLI flag / env var
skaidb --print-config
curl -X POST 127.0.0.1:7080/query \
-d "CREATE TABLE users (PRIMARY KEY (id))"
curl -X POST 127.0.0.1:7080/query \
-d "INSERT INTO users (id, name) VALUES (1, 'ada')"
curl -X POST 127.0.0.1:7080/query \
-d '{"sql":"SELECT * FROM users"}'
# nearest node — auto-discovers the cluster skaidbsh --host 127.0.0.1 # one-shot skaidbsh --host node1 -e "SELECT COUNT(*) FROM users" # offline, embedded engine skaidbsh --local ./data -e "SELECT * FROM users"
The node also serves a built-in web UI at 127.0.0.1:7080/ui — status, SQL console, and admin ops, embedded in the binary.
Every node serves reads and writes. Consistent-hash ring, tunable quorums (ONE / QUORUM / ALL), linearizable per-row UPDATEs, read-repair, hinted handoff and anti-entropy.
Schema-less documents under a declared primary key. Joins, subqueries, CTEs, UNNEST, window functions, views, sequences, generated columns, UNIQUE and FOREIGN KEY constraints, and transactions.
Write-ahead log with crash recovery, SSTables with Bloom filters and block checksums, lazy-leveled compaction, group-commit fsync, and one memory target that sizes buffers and caches.
Composite, multikey, unique and global value-sharded indexes. Index-served ORDER BY, index-only counts, and EXPLAIN to see which index a query uses.
BM25 ranking from SQL with MATCH() and SEARCH(): analyzers, phrase, prefix and fuzzy predicates, highlights, suggestions and facet counts. Includes an Elasticsearch-compatible REST subset.
HNSW nearest-neighbor search with filters, quantized indexes, managed embeddings, hybrid ranking with RANK BY RRF, and reranking. Distributed across the cluster.
geo_distance and geo_bbox work anywhere in WHERE or ORDER BY. A geo index prunes them to a neighborhood: on disk, distributed, maintained on writes.
Gorilla-compressed chunks at 1.0–1.5 bytes/sample on typical fleet metrics, ≥2M samples/s single-node ingest. Retention, rollups, time_bucket() and rate(), PromQL and Prometheus remote_write.
MQTT 3.1.1 and 5.0 over TCP, TLS and WebSocket. Broker state lives in replicated tables, topics have ACLs, and a topic→table sink lands messages as rows.
psql, psycopg, asyncpg, node-postgres, pgx and the JDBC driver connect as they would to PostgreSQL: SCRAM login, prepared statements, COPY, cursors and cancel. It carries skaidb SQL — the protocol, not the PostgreSQL dialect.
CREATE PROCEDURE stores a statement list that CALL runs in one round trip. CREATE JOB runs it on an interval or a cron schedule, CREATE TRIGGER when a matching row changes.
CREATE STREAM is a standing filter over a table's writes. Matching changes are captured, kept for a retention window you can replay, and published live over MQTT.
BACKUP TO updates an existing backup incrementally. RESTORE … TO TIMESTAMP replays archived WAL segments on top of one. Witness nodes mirror chosen databases off-site.
Nodes join or leave while the cluster serves traffic. A join moves roughly 1/(N+1) of the keyspace onto the new node; a leave moves about 1/N.
SCRAM-SHA-256 logins, RBAC with column-level grants, TLS for clients and between nodes, at-rest encryption, and Kerberos/GSSAPI single sign-on.
An admin UI embedded in the binary on every node. Prometheus metrics, and Grafana's Prometheus datasource works against a node directly. The advisor turns cluster signals into findings.
skaidb ships as compiled packages from the signed repository at repo.dsys.org. Installing via apt keeps upgrades automatic; direct downloads are below. The Android SDK is in the Maven repository at repo.dsys.org/maven; it and the embedded library are also tarballs in the release directory, with signed checksums beside them.
In Gradle, add the repository https://repo.dsys.org/maven and depend on org.skaidb:skaidb-android-kotlin:0.354.16. The bundle holds the same artifacts for offline builds, the native libraries with their symbols, and the license of every linked dependency.
libskaidb_embedded, static and shared, with its header: include/ and lib/ in one tarball per target.
Every tarball of this release, with SHA256SUMS and its signature, SHA256SUMS.asc.
Every package installs skaidb + skaidbsh, a systemd unit, and a default config. See the install guide for containers and other platforms, and DOCKER for compose examples. The Android guide has the Gradle lines for the Maven repository, and the embedded guide the link line for C.
Each driver mirrors the idiomatic database API of its language and speaks the binary protocol directly, with SCRAM auth, TLS, typed parameters and streaming. Python, Node.js, Go, Java, Rust, Ruby and PHP install with their usual tools (pip, npm, go get, JitPack, cargo, gem, Composer); the .NET package and the C library ship as release files. The drivers page has every guide.