Skip to content

kwhorne/ElyraSQL

Repository files navigation

ElyraSQL

ElyraSQL

The modern SQL database that speaks MySQL — one file, blazing fast, AI-ready.

A robust, MySQL-compatible SQL server written in Rust.

Single-file · ACID · OLAP-ready · vector-native · AI-native

CI Release License: MIT Docker Docs

Documentation · Quick start · Benchmarks · Framework guide · Changelog


Drop-in for MySQL. Built for what comes next.

ElyraSQL speaks the MySQL wire protocol, so your existing clients, drivers and frameworks — Laravel, Django, Rails, Node, Go, Rust — connect unchanged. But underneath it's a fresh, Rust-native engine built for 2026: the entire database lives in a single crash-safe file, large analytical queries run through a parallel streaming engine, and vector search + AI embeddings are first-class SQL — no bolt-on extensions, no second system to operate.

One binary. One file. Your whole transactional, analytical and AI-search workload — served over the protocol your stack already knows.

→ Get started in 60 seconds  ·  → Full documentation

Stable release: v1.2.0. A broad, MySQL-compatible SQL engine: full DDL/DML, all join types (INNER/LEFT/RIGHT/FULL/CROSS, streamed for large analytical joins), subqueries (correlated too), CTEs (incl. WITH RECURSIVE), window functions, GROUP BY ... WITH ROLLUP, set operations, transactions (snapshot + serializable), a large function catalog with exact DECIMAL and BIGINT UNSIGNED, per-column collation, ENUM/SET validation, introspection (SHOW + INFORMATION_SCHEMA), vector + full-text + hybrid search, and parallel OLAP aggregation. Native mysql_native_password / caching_sha2_password auth, TLS, replication and Raft failover. Correctness is guarded by wire, property, fuzz, crash-recovery and concurrent soak/chaos tests. See the changelog.

Why ElyraSQL

  • Framework-ready — runs Laravel/Eloquent (migrations, models, relationships, transactions) and any MySQL-driver stack; see the Framework Integration guide.
  • MySQL wire protocol — connect with mysql, DBeaver, Workbench, or any MySQL driver in any language. No custom client required.
  • Native client — prefer something purpose-built? ElyraSQL ships its own native client: elyracode.com/sql/client.
  • One file — the entire database lives in a single ACID file (*.edb), crash-safe with a single-writer / multi-reader model.
  • OLAP-ready — large aggregations run through a parallel, streaming engine with memory proportional to the number of groups, not the table size.
  • Vector-nativeVECTOR(n) columns with ANN search, MySQL-flavoured distance functions.
  • AI-native searchHYBRID(...) fuses full-text + vector ranking (RRF) in one query, and ai_embed('text') generates embeddings in SQL via an OpenAI-compatible endpoint: the RAG stack in one file, no external search engine.
  • MIT licensed, targets Ubuntu 24.04+ for production, develops anywhere Rust runs.

SQL support

  • DDLCREATE/ALTER/DROP TABLE (incl. MODIFY/CHANGE/SET DEFAULT), CREATE TABLE ... AS SELECT, CREATE TABLE ... LIKE, TRUNCATE, CREATE/DROP VIEW, CREATE INDEX; primary/composite keys, secondary and vector indexes; DEFAULT, AUTO_INCREMENT, generated columns, ENUM/SET.
  • Constraints — enforced PRIMARY KEY, UNIQUE, NOT NULL, CHECK, and FOREIGN KEY (with ON DELETE RESTRICT/CASCADE/SET NULL).
  • DMLINSERT (multi-row, INSERT ... SELECT), upserts (REPLACE, INSERT IGNORE, ON DUPLICATE KEY UPDATE), UPDATE/DELETE with subqueries and multi-table joins.
  • Queries — all join types, GROUP BY/HAVING, ORDER BY/LIMIT, subqueries (uncorrelated and correlated, incl. over joins), derived tables, CTEs and WITH RECURSIVE, window functions with frames, set operations (UNION/INTERSECT/EXCEPT).
  • Functions — string, math, date/time (incl. INTERVAL arithmetic), conditional, CAST, REGEXP, JSON, vector, and aggregates including GROUP_CONCAT and conditional aggregates. Exact DECIMAL arithmetic.
  • TransactionsBEGIN/COMMIT/ROLLBACK, SAVEPOINT, snapshot and opt-in serializable isolation, and SELECT ... FOR UPDATE/FOR SHARE (optimistic row locking).
  • Backup — hot, consistent BACKUP TO '<path>' while serving, plus offline elyrasql backup/restore CLI commands.
  • Programmability — row-level triggers (BEFORE/AFTER with NEW/OLD), stored procedures with parameters, variables and IF/WHILE, and full-text MATCH ... AGAINST.
  • Users & access control — persistent accounts via CREATE USER/DROP USER, GRANT/REVOKE, SET PASSWORD, SHOW GRANTS; coarse read/write/admin privileges; mysql_native_password auth; optional TLS.
  • ObservabilitySHOW STATUS counters, SHOW PROCESSLIST, an optional slow-query log (--slow-query-ms), and a Prometheus /metrics endpoint.
  • Replication & HA — asynchronous primary → read-replica streaming, optional semi-sync, and automatic failover via Raft-style leader election (elyrasql cluster).
  • IntrospectionSHOW TABLES/COLUMNS/INDEX, SHOW CREATE TABLE, DESCRIBE, and a queryable INFORMATION_SCHEMA.

See the documentation site and limitations for the full, honest picture.

Architecture

              MySQL clients / drivers
                       │  (MySQL wire protocol)
              ┌────────▼────────┐
              │  elyra-server   │   elyra-wire (own MySQL protocol) + tokio
              └────────┬────────┘
              ┌────────▼────────┐
              │  elyra-engine   │   sqlparser (MySQL dialect) → plan → execute
              └───┬────────┬────┘
      ┌───────────▼──┐  ┌──▼───────────┐  ┌──────────────┐
      │ elyra-storage│  │  elyra-olap  │  │ elyra-vector │
      │ single file  │  │  analytics   │  │  ANN / HNSW  │
      │ ACID (redb)  │  │  (columnar)  │  │              │
      └──────────────┘  └──────────────┘  └──────────────┘
                    all share  ▲  elyra-core (types, values, errors)

Crates:

Crate Responsibility
elyra-core Shared value/type model, errors, branding constants
elyra-storage Single-file ACID key/value engine, namespaced keyspace
elyra-engine SQL parsing (MySQL dialect), planning, execution
elyra-olap Parallel, streaming group-aggregation kernel
elyra-vector Vector column type + ANN search (exact + HNSW)
elyra-wire First-party MySQL wire protocol (handshake, auth, TLS)
elyra-server Connection handling, auth verification, prepared statements
elyra-cli elyrasql binary (serve + admin)

Third-party engines are internal dependencies only — nothing user-facing (APIs, errors, CLI, wire handshake) exposes their names. Everything is ElyraSQL.

Quick start

# Build
cargo build --release

# Run the server (creates elyra.edb if missing)
./target/release/elyrasql serve --data elyra.edb --listen 127.0.0.1:3307

# With authentication + TLS
./target/release/elyrasql serve \
    --user root --password s3cret \
    --tls-cert server.crt --tls-key server.key

# Connect with any MySQL client
mysql -h 127.0.0.1 -P 3307 -u root -p
SELECT 1;
SELECT 1 + 1 AS two;
SELECT 'hei fra ElyraSQL' AS msg;
SELECT VERSION();   -- 8.0.0-ElyraSQL-1.2.0

Configuration

Flag / env Default Meaning
--data / ELYRASQL_DATA elyra.edb Path to the single DB file
--listen / ELYRASQL_LISTEN 127.0.0.1:3307 Bind address (MySQL proto)
RUST_LOG info Log level

Performance

See BENCHMARKS.md for a reproducible benchmark harness and results, and benchmark_analyse.md for a head-to-head comparison against MySQL 8.4, Percona 8.4 and PostgreSQL 17.

Highlights (200k rows, same host): ElyraSQL beats MySQL and Percona on full-table COUNT and bulk insert and matches PostgreSQL on full-scan COUNT; PK lookup ~0.2 ms, selective join ~0.27 ms, cached vector ANN ~0.3 ms, bulk ingest ~183k rows/s.

Install

Static Linux binaries (x86_64 and aarch64) are attached to each GitHub Release:

curl -L -o elyrasql.tar.gz \
  https://github.com/kwhorne/ElyraSQL/releases/download/v1.2.0/elyrasql-1.2.0-linux-x86_64.tar.gz
tar xzf elyrasql.tar.gz && ./elyrasql-1.2.0-linux-x86_64/elyrasql serve

Docker

Multi-arch image (amd64 + arm64) on GHCR:

docker run -p 3307:3307 -v elyra:/var/lib/elyrasql ghcr.io/kwhorne/elyrasql:1.2.0
# with auth + a persistent volume:
docker run -p 3307:3307 -v elyra:/var/lib/elyrasql \
  -e ELYRASQL_USER=root -e ELYRASQL_PASSWORD=secret \
  ghcr.io/kwhorne/elyrasql:latest

Deploying on Ubuntu 24.04+

sudo ./packaging/deploy.sh            # build, install, systemd, start
# or with credentials + TLS:
ELYRASQL_USER=root ELYRASQL_PASSWORD=secret \
  ELYRASQL_LISTEN=0.0.0.0:3307 sudo -E ./packaging/deploy.sh
journalctl -u elyrasql -f

Learn more

License

MIT — see LICENSE. Use it freely, in commercial and open projects alike.


ElyraSQL

ElyraSQL — part of the Elyra family.

Developed with ❤️ from Norway 🇳🇴

About

A robust, MySQL-compatible SQL server in Rust — single ACID file, vector search (HNSW), and parallel OLAP.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages