HeliosDB Nano
An embedded database with native PostgreSQL and MySQL wire-protocol compatibility, plus one-shot SQLite file import. Single 47 MB binary. HNSW vector search, git-like branching, time-travel queries, AES-256-GCM encryption, built-in BaaS layer (Auth, REST API, Realtime).
Use your existing clients (psql, mysql), RESTful HTTP, drivers (psycopg2, mysql-connector, node-postgres, JDBC), and ORMs (SQLAlchemy, Prisma, Drizzle, Hibernate, GORM) — zero migration required. Existing .sqlite files import via a bundled converter.
Install
# npm (cross-platform, auto-downloads binary)
# Homebrew (macOS / Linux)
# Docker
# Binary release
|
Start the Server
# Persistent, all three protocols
# In-memory (great for dev/test)
# With auth and TLS
# Same-host / embedded mode — Unix sockets (no TCP)
# then: psql -h /tmp or mysql --socket=/tmp/heliosdb-mysql.sock
Three servers start on one process:
| Protocol | Port | Connect |
|---|---|---|
| PostgreSQL wire | 5432 | psql, psycopg2, pgx, JDBC, Npgsql, node-postgres |
| PostgreSQL Unix socket | /tmp/.s.PGSQL.5432 |
psql -h /tmp, libpq-default apps |
| MySQL wire | 3306 | mysql, PyMySQL, SQLAlchemy, JDBC, mysql2 |
| MySQL Unix socket | /tmp/heliosdb-mysql.sock (configurable) |
mysql --socket=…, PHP mysqli, WordPress |
| REST / HTTP | 8080 | curl, fetch, any HTTP client |
Triple Compatibility — Same Data, Any Client
Start the server once, then connect from any of the three interfaces. They all read and write the same tables.
Interactive REPL (zero setup)
));
) ));
;
| |
| |
()
PostgreSQL Client (psql)
)
postgres=# ) );
postgres=# ) ;
MySQL Client (mysql)
;
| | | |
| | | |
| | | |
) );
REST API (curl)
# Query
}}
# Insert
# Interactive API explorer (Swagger UI)
Vector Search
Native HNSW indexes — no extensions, no separate vector database.
-- From any client (psql / mysql / REPL):
(
id SERIAL PRIMARY KEY,
title TEXT,
embedding VECTOR(1536)
);
(embedding vector_cosine_ops);
INSERT INTO docs (title, embedding)
VALUES ('Intro', '[0.1, 0.2, 0.3, ...]');
-- k-NN search
SELECT title, embedding <-> '[0.15, 0.25, ...]' AS distance
FROM docs
ORDER BY distance
LIMIT 10;
Distance operators: <-> (cosine), <~> (L2), <#> (inner product).
Via REST:
Full-Text Search
PostgreSQL-compatible FTS surface — no extensions, backed by built-in BM25:
-- Native tsvector / tsquery / @@ / ts_rank_cd:
SELECT title, ts_rank_cd(to_tsvector(body), to_tsquery('heliosdb')) AS rank
FROM articles
WHERE to_tsvector(body) @@ to_tsquery('heliosdb')
ORDER BY rank DESC
LIMIT 10;
-- Persistent tsvector column + GIN-style DDL:
(id SERIAL PRIMARY KEY, body TEXT, body_tsv TSVECTOR);
(body_tsv);
-- Hybrid search (FTS + vector) in one query:
SELECT id, text,
0.7 * (1.0 - (embedding <=> $1::vector))
+ 0.3 * ts_rank_cd(to_tsvector(text), plainto_tsquery($2)) AS score
FROM chunks
ORDER BY score DESC LIMIT 10;
Scope and honest limitations: see docs/compatibility/fts.md.
Pagination — Constant-Time at Depth
Deep LIMIT … OFFSET runs in ~30 µs regardless of offset, up to 334× faster
than PostgreSQL 13 for 100k-row tables. Top-K over Sort, storage-level
OFFSET skip, and keyset (WHERE (col, id) < ($1, $2)) are all native.
See pagination-performance.html for measured numbers and reproduction recipe.
Git-Like Branching
Isolated copy-on-write branches for dev, test, and A/B experiments.
CREATE BRANCH staging FROM main;
USE BRANCH staging;
-- Changes here are invisible to main
INSERT INTO products (name, price) VALUES ('Test', 0.01);
MERGE BRANCH staging INTO main;
DROP BRANCH staging;
Time-Travel Queries
-- As of a timestamp
SELECT * FROM products AS OF TIMESTAMP '2026-04-01 12:00:00';
-- As of a transaction
SELECT * FROM products AS OF TRANSACTION 12345;
Built-in Backend-as-a-Service
Self-hosted Supabase/Firebase alternative — Auth, REST, Realtime, RLS in the same binary:
# Sign up
# Google OAuth redirect
# Realtime subscriptions (WebSocket)
RLS is automatic on REST endpoints via JWT claims. See vs-supabase.
ORM & Driver Compatibility
| Language | PostgreSQL driver | MySQL driver | Tested ORMs |
|---|---|---|---|
| Python | psycopg2, asyncpg |
PyMySQL, mysql-connector-python |
SQLAlchemy, Django ORM |
| Node.js | pg, node-postgres |
mysql2 |
Prisma, Drizzle, TypeORM, Sequelize |
| Java | JDBC (postgresql) | JDBC (mysql-connector-j) | Hibernate, JPA |
| Go | lib/pq, pgx |
go-sql-driver/mysql |
GORM, ent |
| Rust | tokio-postgres, sqlx |
mysql_async, sqlx |
SeaORM, Diesel |
| PHP | PDO pgsql | mysqli, PDO mysql |
Laravel Eloquent, WordPress |
WordPress runs natively with standard wpdb — no drop-in required.
Data Types
All PostgreSQL types plus MySQL type aliases (automatically translated):
| Canonical | Aliases |
|---|---|
BOOLEAN |
BOOL, TINYINT(1) |
SMALLINT / INTEGER / BIGINT |
INT2/INT4/INT8, TINYINT, MEDIUMINT |
REAL / DOUBLE PRECISION |
FLOAT4/FLOAT8, FLOAT(N) |
NUMERIC(p,s) |
DECIMAL(p,s) |
TEXT |
VARCHAR(n), LONGTEXT, MEDIUMTEXT, TINYTEXT |
BYTEA |
BLOB, LONGBLOB, MEDIUMBLOB |
TIMESTAMP |
DATETIME |
SERIAL / BIGSERIAL |
INT AUTO_INCREMENT, BIGINT AUTO_INCREMENT |
UUID, JSON, JSONB, VECTOR(n), ARRAY |
— |
TSVECTOR, TSQUERY |
stored as JSON arrays of normalised tokens |
Features at a Glance
- Full SQL: JOINs, CTEs, window functions, subqueries, set operations, aggregates, CASE
- PL/pgSQL: Stored procedures and functions
- JSONB:
->,->>,@>,?operators - Full-text search:
tsvector,tsquery,@@,ts_rank_cd,CREATE INDEX ... USING gin(see FTS scope) - Keyset pagination: row-constructor comparison
WHERE (col, id) < ($1, $2); top-K sort; constant-time deep OFFSET - Foreign keys: CASCADE, SET NULL, RESTRICT
- Triggers: BEFORE/AFTER INSERT/UPDATE/DELETE
- Row-Level Security: Per-tenant data isolation via policies
- EXPLAIN: Cost-based optimizer, ANALYZE, JSON/XML/YAML output
- Code-graph (opt-in,
--features code-graph): tree-sitter-backed AST index +lsp_definition/lsp_references/lsp_call_hierarchy/lsp_hoveras Rust API & SQL table functions — see code-graph overview - Backup/Restore: Compressed dumps (zstd/gzip/brotli)
- Import/Export: CSV, JSON, JSONL, Parquet, Arrow, SQL
- Audit logging: Tamper-proof trail (SHA-256 checksums)
- Encryption: AES-256-GCM TDE, FIPS 140-3 mode
- Unix domain socket listeners for both PostgreSQL (
--pg-socket-dir /tmp) and MySQL (--mysql-socket /tmp/heliosdb.sock) — PHPmysqli/ WordPress embedded-mode and libpq defaults work out of the box
Architecture
| Layer | Technology |
|---|---|
| Storage engine | RocksDB (LSM-tree) |
| Columnar format | Apache Arrow |
| SQL parser | sqlparser-rs |
| Vector index | HNSW + Product Quantization |
| Wire protocols | PostgreSQL v3, MySQL v10 |
| HTTP server | Axum |
| Encryption | AES-256-GCM, AWS-LC FIPS |
High Availability
Warm standby is enabled by default — no feature flag needed. Just pass the replication flags at startup:
# Primary
# Standby
Optional HA features (opt-in at compile time):
| Flag | Description |
|---|---|
ha-tier1 |
Warm standby — enabled by default |
ha-tier2 |
Multi-primary: branch-based active-active |
ha-tier3 |
Sharding: consistent hash ring |
ha-dedup |
Content-addressed deduplication across nodes |
ha-ab-testing |
Branch-based experiment routing |
ha-branch-replication |
Selective branch sync to remote servers |
ha-full |
All optional HA features bundled |
Connection Routing & Load Balancing
For production deployments with multiple HeliosDB Nano instances, put HeliosProxy in front — a standalone binary providing:
- Read/write splitting across primary + standbys
- Automatic failover with transaction replay (Oracle TAF-style)
- Connection pooling
- Health checks + circuit breakers
- TLS termination
Recommended Production Setup
┌────────────────┐
psql ─▶│ │──▶ HeliosDB Nano (primary, read+write)
mysql ─▶│ HeliosProxy │──▶ HeliosDB Nano (standby, read-only)
curl ─▶│ │──▶ HeliosDB Nano (standby, read-only)
└────────────────┘
port 5432/3306/8080
- Deploy 1 primary + 2 standbys (Fly.io / Render / Docker Swarm)
- HeliosProxy in front for routing + failover
- Automatic failover on primary death (< 5 s typical)
- Readonly queries load-balanced across standbys
Deploy
| Platform | Template |
|---|---|
| Fly.io | deployment/flyio/ |
| Railway | deployment/railway/ |
| Render | deployment/render/ |
| Docker | deployment/docker/ |
Embedded Library (Rust)
For in-process use (no network, no daemon), add the crate as a dependency:
[]
= "3.13"
See the Rust API guide for embedded usage and the examples/ directory for working code.
Building from Source
The heliosdb-nano binary builds with cargo build --release. Default features are encryption + vector-search + ring-crypto + ha-tier1 — covers most embedded and single-node-server cases. Run cargo info heliosdb-nano (or cargo metadata --no-deps --format-version 1 | jq '.packages[0].features') for the live list. Recipes for the non-obvious combinations:
# Default build — embedded + Postgres/MySQL wire + warm-standby HA.
# Code-graph + MCP server (matches what heliosdb-codekb-mcp links).
# Adds tree-sitter parsers, _hdb_code_* tables, lsp_* APIs, and the
# JSON-RPC dispatcher for stdio / HTTP / WebSocket / SSE clients.
# In-process embedder (no external HTTP service for embeddings).
# Pulls fastembed-rs + ORT — adds ~30 MB to the binary.
# FIPS 140-3 compliant crypto (AWS-LC FIPS Cert #4816, SHA-256, PBKDF2).
# `--no-default-features` is required to swap out ring-crypto.
# Full HA bundle — multi-primary + sharding + dedup + branch replication.
SDKs & Integrations
Official client SDKs (Go, Python, TypeScript, Rust) and platform integrations (VS Code, Zapier, n8n, Retool, Make, AutoGen) live in a shared repository:
heliosdb-sdks — works with all HeliosDB editions.
# JavaScript / TypeScript (Supabase-compatible fluent API)
import from '@heliosdb/client'
const db =
const = await db...
Documentation
- Getting Started
- API Explorer (Swagger UI) — when running locally
- vs Supabase
- vs Firebase
- vs PostgreSQL
- vs SQLite
- Migrate from MySQL
License
Apache-2.0 — Apache License, Version 2.0