K
KESSELDB
GitHub →
v2.0.0 · Hyperdrive engaged

The database that made
the Kessel Run in 12 parsecs.

Deterministic, replicated SQL with PostgreSQL-style flexibility on a TigerBeetle-style core. 14.71M point reads/sec at K=8, 6.02× Postgres on OLTP read-only, TLA+ verified VSR. Pure Rust, zero deps. Single binary, Docker, or Helm.

cockpit ~ millennium-falcon
# Binary CLI
$ kessel "CREATE TABLE acct (owner U32 NOT NULL, bal I64 NOT NULL)"
$ kessel "SELECT SUM(bal) FROM acct WHERE owner = 100"
=> 50  · 0.00012s# HTTP/JSON
$ curl -s -X POST --data-binary 'SELECT * FROM acct'     -H 'Authorization: Bearer mysecret' http://127.0.0.1:8080/v1/sql# PostgreSQL wire
$ PGPASSWORD=mysecret psql -h 127.0.0.1 -p 5432 -U test
  => SELECT * FROM acct
14.71M
Point reads / sec (K=8)
6.02×
OLTP RO vs Postgres (N=16)
51,840
COPY FROM rows / sec
0
External deps in kernel

// ship systems

Engineered for lightspeed

Hyperdrive SQL

CREATE / ALTER (online, no lock) / DROP, INNER/LEFT/RIGHT/FULL JOIN, GROUP BY, HAVING, indexes, FK with ON DELETE actions, CHECK, deterministic triggers — real SQL, no compromises.

Viewstamped Replication

Multi-node VSR over real TCP. Safety-hardened against view-change op loss and liveness-tested under an adversarial partition corpus. Survives partitions like a YT-1300 survives Imperial fire.

TLA+ Verified Core

Seven layered TLA+ modules (Replication → MVCC backbone). TLC model-checks VSR safety across 528M distinct states at depth 21 — zero counterexamples.

MVCC + Cahill SSI

Every SQL statement is a deterministic MVCC transaction with snapshot isolation + Cahill SSI. Write-skew impossible. Replicas reach byte-identical state at every commit. 5 Jepsen-style linearizability tests pass under partition.

Four Wire Protocols

Binary fast path, HTTP/1.1 + JSON (/v1/sql, /v1/metrics Prometheus), WebSocket /v1/ws, and PostgreSQL v3.0 with Simple + Extended Query, binary Bind, and SCRAM-SHA-256.

PG Ecosystem Verified

psql, pgcli, pgAdmin, DBeaver, DataGrip, Metabase, Tableau. Real driver CRUD green in simple + extended modes: pgJDBC 42.7.4, psycopg2/3, SQLAlchemy 2.0, asyncpg. COPY FROM STDIN text + CSV + binary at ~51,840 rows/sec.

Deterministic WASM UDFs

Zero-dep WASM-MVP interpreter for CHECK / trigger user functions. Gas-bounded, no host calls, no clocks. Every replica runs byte-identical UDF logic — replayable from the log.

Parquet & External Sources

Register and REFRESH JSON / NDJSON / CSV / Parquet from HTTP(S), S3, or Azure Blob. Pure-Rust zero-dep Parquet reader covers the full 6-codec × V1/V2 × PLAIN/dictionary matrix up to 3-deep nesting.

Cross-Shard Scatter Scan

K independent VSR shard groups, zero-dep scatter-gather with bounded per-shard channels and BinaryHeap k-way merge. K-invariance locked by 85-seed × 5-K sweep: byte-identical output for K ∈ {1,2,4,8,16}.

Docker, Helm & Fly.io

Multi-arch (amd64 + arm64) GHCR image, ~77 MiB stripped. Helm chart for single-pod or 3/5-replica VSR cluster with primary-kill failover. fly.toml tested end-to-end in CI.

// pre-flight

Launch sequence

Grab a pre-built binary or build from source. The whole engine is a seedable state machine — ready to jump as soon as you set coordinates.

01Calibrate the navicomputer
02Charge the hyperdrive
03Punch it
Read the full docs →
// docker (fastest jump)
docker run --rm \
  -p 6532:6532 -p 6533:6533 -p 5432:5432 \
  -v $PWD/kesseldb-data:/data \
  -e KESSELDB_TOKEN=changeme \
  ghcr.io/hassard0/kesseldb:latest
// pre-built binary (linux x86_64)
VER=v2.0.0  # see releases for latest
curl -L https://github.com/hassard0/KesselDB/releases/download/$VER/kesseldb-$VER-x86_64-unknown-linux-gnu \
  -o kesseldb && chmod +x kesseldb

./kesseldb 127.0.0.1:7878 ./data
// build from source
git clone https://github.com/hassard0/KesselDB && cd KesselDB
cargo build --release --features pg-gateway,http-gateway

./target/release/kesseldb 127.0.0.1:7878 ./data