The
Monster
Database Engine.

- 26
- 8
- 0
- 100
Layered, composable modules
x throughput via MVCC
Pure safe Rust throughout
% SQLite-compatible
What Makes It Different
Concurrent writers, self-healing pages, and compiler-enforced safety, built into the engine, not bolted on.
Concurrent Writers
Self-Healing Storage
File Compatibility
Zero Unsafe
Full SQL Support
Extension Ecosystem
Time-Travel Queries
FOR SYSTEM_TIME AS OF. No snapshots, no replicas, no forks.Dual Storage Modes
Page-Level Encryption
Transaction Observability
Adaptive Indexing
Structured Concurrency
SQLITE_BUSY. The engine acquires a single global write lock, so every concurrent writer queues behind it, one at a time, no exceptions. Under load, you either retry in a loop or serialize your entire write path through a single thread.FrankenSQLite eliminates this bottleneck. Its gives each writer a private of only the pages it touches. Eight writers proceed in parallel, operating on different pages simultaneously, with zero lock contention and zero
SQLITE_BUSY errors. The race below shows exactly what that difference looks like under load.The visibility rule fits in a single line of code: if a page version's commit sequence number is higher than your snapshot's, you cannot see it. This one invariant is what makes the entire system correct. Click through the tree below to watch create new page versions while the original tree stays intact for concurrent readers.
Writes never modify the original page. Instead, the engine creates a , applies the mutation to the copy, and re-links parent pointers upward through the tree. Chain enough shadow copies together and you get : multiple page versions coexisting without conflict, each visible only to the transactions that should see them. Step through the visualization below to watch the read path descend and the write path fork.
FrankenSQLite can replace this traversal with a : a compact mathematical model trained on the actual key distribution. It predicts where a key lives on disk in O(1) time, one multiplication instead of twenty random reads. The model retrains incrementally as data changes, so it stays accurate without manual intervention. Click a query button below to see the model predict a key's location, then compare the result against a traditional tree walk.
inverts this entirely. The first range query on a column physically partitions the data in-place as a side effect of answering the query. The second query refines that partition. Each subsequent query tightens the physical layout toward exactly the access pattern your application produces, with zero DBA intervention and zero upfront cost. Run the three queries below and watch the array reorganize itself after each one.
SELECT * table scan can destroy a standard LRU buffer pool. Every sequentially-read page pushes out a frequently-accessed hot page that will be needed again milliseconds later. The result: cache miss storms, I/O spikes, and latency cliffs under mixed workloads.FrankenSQLite's prevents this. A state machine governs eviction: pages transition through Hot, Cooling, and Cold states. Only pages that survive an entire cooling cycle without a single re-access become eviction candidates. Hot interior nodes use to bypass the page cache lookup entirely. Try clicking pages below to re-heat them, then run a background scan to watch the cooling cycle in action.
Standard SQLite serializes all writes through a single WAL writer. FrankenSQLite gives each writer its own lane via the , and readers locate the most recent version of any page through a lock-free in shared memory. Use the tabs below to switch between Normal mode (live write appends), Checkpoint mode (flushing WAL frames back to the main file), and Crash Recovery (discarding uncommitted data after a simulated crash).
PRAGMA integrity_check) to detect and repair this damage after the fact.FrankenSQLite builds recovery directly into the storage engine. generate for every data page at write time. When corruption is detected on read, whether from bit rot, disk error, or cosmic ray, reconstructs the original bytes from the surviving symbols. No backup restore. No operator intervention. Automatic recovery, guaranteed within the configured overhead budget. Click the healthy pages below to simulate corruption and watch the engine reconstruct them in real time.
The places raw source data first in each block, so normal reads are zero-copy with no decoding overhead at all. The repair symbols sit alongside, inert until corruption is detected. You get append-only crash safety and self-healing durability in a single file format. Press Start DB Writers below to watch data pages and repair symbols stream to disk, then click a page to corrupt it and observe automatic recovery.
When cells do overlap, guarantees correctness. The engine maintains a , a live dependency graph that detects dangerous using the cycle detection rule. If a cycle forms, the pivot transaction is aborted. If no cycle exists, both transactions commit. ensures the outcome is deterministic and fair. Step through the two visualizations below to see the Witness Plane build its graph and SSI validate a commit sequence.
SQLITE_BUSY. The application retries, hopes for the best, and accepts the throughput hit.FrankenSQLite's tries four strategies in descending order of confidence before giving up. First: , re-executing the transaction's operation log against the updated . Second: , finding a canonical merge of operations that are mathematically independent. Third: byte-level merge, combining non-overlapping byte changes on the same page. Only when all three strategies fail does the engine abort and retry, which is the same behavior other databases start with as their only option. Step through below to watch the XOR delta merge resolve a conflict that would have caused
SQLITE_BUSY in standard SQLite.EXPLAIN QUERY PLAN shows the plan, not the execution. There is no built-in way to see where wall-clock time actually goes inside a running transaction.FrankenSQLite's native records the exact microsecond of every operation:
BEGIN, each read, each write, savepoints, rollbacks, and COMMIT. It emits Chrome DevTools-compatible JSON traces for visual inspection and actively flags anti-patterns, including long-held , excessive rollbacks, and lock contention, before they reach production. Switch between the Healthy and Anti-Pattern tabs below to see what clean and pathological transaction timelines look like.FrankenSQLite has across all 26 crates.
#[forbid(unsafe_code)] on every crate makes buffer overflows, use-after-free, and data races impossible at compile time. wrap every ID type (PageNo, TxnId, FrameNo) so the compiler rejects category confusion at build time, not at 3 AM in production. The dashboard below shows the safety guarantees; switch to the Rust tab in the newtype demo to see the compiler catch a type mix-up that C would silently accept.Key derivation uses , a memory-hard KDF that resists GPU and ASIC brute-force attacks. Encryption is built into the storage layer, not bolted on as a paid extension. Step through the pipeline below to follow a plaintext page from passphrase derivation through nonce generation, AEAD encryption, and authenticated verification.
Every stage lives in a separate crate with its own tests and version number. Swap the parser, keep the engine. Replace the planner, keep the . This is what 26 composable crates buy you. Step through the bytecode execution below: watch the program counter advance, registers fill, and rows materialize from opcodes.
Connection, Statement, Row. Everything described on this page, concurrency, self-healing, , , works transparently beneath this interface. You write standard SQL and get the safety of Rust, the concurrency of a server-grade database, and the simplicity of an embedded engine.01 fsqlite::Connection;02 fsqlite_error::Result;03 fsqlite_types::value::SqliteValue;04 05 main() -> Result<()> {06 db = Connection::open("app.db")?;07 08 db.execute(09 "CREATE TABLE IF NOT EXISTS users (10 id INTEGER PRIMARY KEY,11 name TEXT NOT NULL,12 email TEXT UNIQUE13 )",14 )?;15 16 db.execute_with_params(17 "INSERT INTO users (name, email) VALUES (?1, ?2)",18 &[19 SqliteValue::Text("Alice".to_owned()),20 SqliteValue::Text("alice@example.com".to_owned()),21 ],22 )?;23 24 stmt = db.prepare("SELECT id, name FROM users WHERE name = ?1")?;25 rows = stmt.query_with_params(26 &[SqliteValue::Text("Alice".to_owned())],27 )?;28 29 row &rows {30 id = row.get(0).expect("id column");31 name = row.get(1).expect("name column");32 println!("Found: {id:?} — {name:?}");33 }34 35 Ok(())36}| Feature | C SQLite | libSQL | DuckDB | |
|---|---|---|---|---|
| ✓First-class | ✕Single writer | ⚠Enhanced WAL | ✓First-class | |
| ✓Enforced | ✕Manual | ✕Manual | ✕Manual | |
| ✓Built-in | ✕No | ✕No | ✕No | |
| ✓Yes | —N/A (C) | —N/A (C) | —N/A (C++) | |
| ✓Page-level | ⚠WAL-only | ⚠Extended WAL | ✓Row-level | |
| ✓First-class | ✓First-class | ✓First-class | ⚠Extended | |
| ✓First-class | ✓First-class | ✓First-class | ✓First-class | |
| ✓First-class | ✓Native | ✓Native | ✕No | |
| ⚠Basic | ⚠Basic | ⚠Basic | ✓First-class | |
| ✓Built-in | SEE (paid) | ✕No | ✕No | |
| ⚠Early | ✓20+ years | ⚠Growing | ✓Mature | |
| ✓Built-in | ✕No | ✕No | ✕No | |
| Multi-strategy merge | Abort + retry | Abort + retry | Row-level MVCC | |
| sqlite3 + ECS | sqlite3 | sqlite3 | Proprietary | |
| Learned + cracking | Manual only | Manual only | ART indexes | |
| ARC (self-tuning) | LRU | LRU | Custom | |
| Cx + budgets | —N/A | —N/A | Thread pool |
fsqlite-parser. Need the engine without the query layer? Depend on fsqlite-btree. Need concurrency? Add fsqlite-mvcc. Each crate compiles independently, so downstream projects pull in only the layers they need, nothing more.Public API facade
SQL abstract syntax tree node types
B-tree storage engine handling the fundamental
layoutSQLite C API compatibility shim for drop-in replacement
Interactive SQL shell
Core engine: connection, prepare, schema, DDL/DML codegen
End-to-end differential testing and benchmark harness
Structured error types
FTS3/FTS4 full-text search extension
FTS5 full-text search extension
ICU collation extension
JSON1 functions and virtual tables
Miscellaneous extensions: generate_series, carray, dbstat, dbpage
R-tree and geopoly spatial index extension
Session, changeset, and patchset extension
Built-in scalar, aggregate, and window functions
Conformance test runner and golden file comparison
Conflict analytics and observability infrastructure
Page cache and journal management
Hand-written recursive descent SQL parser
Query planner: name resolution, WHERE analysis, join ordering
Core type definitions
Virtual filesystem abstraction layer
Foundation
Defined core types and error handling across the workspace
Implemented page format parser for .sqlite3 files
Built B-tree reader with copy-on-write page support
Established 26-crate workspace layout and CI pipeline
SQL Engine
Wrote tokenizer and recursive-descent SQL parser
Designed full AST representation for SELECT, INSERT, UPDATE, DELETE
Implemented query planner with cost-based optimization
Built bytecode compiler and interpreter loop
Storage
Implemented with checkpointing
Built page cache with configurable buffer pool sizing
Added crash recovery and rollback journal support
Integrated file locking and concurrency primitives
MVCC + RaptorQ
Implemented with snapshot isolation
Enabled concurrent writers — up to 8x throughput improvement
Integrated fountain codes for page-level error correction
Added automatic self-healing for bit rot and disk corruption
Polish
Built interactive CLI shell with syntax highlighting and autocomplete
Implemented extension API for custom functions and virtual tables
Added FTS5-compatible full-text search engine
Shipped JSON1-compatible functions and path queries
Created SQLite compatibility test suite with 10,000+ test cases
cargo add. Concurrent writers, self-healing pages, and full SQL support from your first commit.cargo add fsqliteThis entire system was architected and built using the AI Flywheel, an interactive ecosystem of specialized autonomous agents.
FrankenSQLite is part of the FrankenSuite, a family of Rust infrastructure projects including FrankenTUI, FrankenSQLite, and more. Each one pushes the boundaries of what safe Rust can achieve.
