r/sqlite • u/web3samy • Oct 05 '26
Pure GO SQLite-compatible database. 75× C SQLite & 200× Turso.
I've been building musql (pronounced "muscle"), a SQLite-compatible database written from scratch.
Repo: https://github.com/samyfodil/musql
It has a `database/sql` driver that registers as `sqlite`, so switching from another SQLite driver is usually just changing the import line. It uses its own storage format (`.musq`), with columns stored contiguously and an append-only delta for writes. `musql-convert` converts existing SQLite files in and out, in both directions.
SQL compiles to VDBE bytecode, the same design as C SQLite. A JIT turns hot paths into native code on amd64 and arm64 (Linux, macOS and Windows).
There's also `musqld`, a server that speaks Turso's Hrana protocol. `@libsql/client` and `libsql-client-go` connect unchanged, and there's a 5 MB Docker image. Replication supports CRDT or leader mode; you supply the network.
For performance, these are 100k-row read workloads, averaged over an amd64 and an arm64 machine:
filtered `count(*)`: ~75x faster than C SQLite, ~210x faster than Turso
sum over a filter: ~8x faster than C SQLite
grouped aggregate: ~2.3x faster; `ORDER BY ... LIMIT`: ~2.4x faster
It also runs Doom. The same VM that runs SQL runs unmodified doomgeneric, compiled C -> LLVM IR -> VDBE bytecode. On an Intel i9 it gets ~38 fps on the bytecode interpreter and ~96 fps with the JIT. The idea came from Turso's demo. You can try it with:
It's early. I'd appreciate feedback on the API and the Hrana server, or a bug report if your SQL breaks. A failing query helps a lot.
2
u/syshukus Oct 06 '26
Can you answer yourself and not use AI? I wanted to ask YOU (author) unless 90% of project is done by AI of course.
DuckDB is not different — it's exactly use-case you're trying to optimize for: analytical queries ON TRANSACTIONAL DB. Do you know that SQLite is OLTP and not OLAP, yes? It's created for transactional workloads, and in your post and on GitHub page you're bragging about how this projects is faster on ANALYTICAL workloads with all this SIMD blabbering and paralleling data processing. So of course I pointed out that existing DuckDB will be much faster on these workloads than your project, because it's ANALYTICAL ENGINE + DB and you have relatively unfair comparisons.
About JIT part, sorry, it was AI-test and you failed it. I suspect you literally understand nearly 0 of what AI's written about JITing code because the answer is GARBAGE with no structured thoughts flow and very little common sense (I guess you asked AI "make this answer short, so it looks like human wrote it)
You have no respect to your probable users, so shame on you.