Skip to main content

Engine architecture

The BoutiqueDB engine is a Rust rewrite of SQLite. It keeps the SQLite file format and SQL dialect but replaces the query execution, storage, and I/O layers with Rust code.

High-level components

Compilation pipeline

The VDBE (Virtual Database Engine) is a register-based virtual machine similar to SQLite’s. Its bytecode is general enough to host multiple frontends; SQLite is the primary frontend, and Postgres is an experimental frontend.

I/O model

The engine supports pluggable I/O backends:
  • syscall — generic blocking file I/O.
  • io_uring — Linux kernel-queued async I/O.
  • experimental_win_iocp — Windows I/O completion ports.
With async_io enabled, the engine returns TURSO_IO from step() and expects the caller to drive run_io() until the operation completes.

Storage compatibility

  • Page size defaults to 4096 bytes.
  • The on-disk format is SQLite-compatible for standard tables and indexes.
  • Turso-only features (custom index methods, generated columns, materialized views, custom types) may write extra state that SQLite does not understand.
For more detail, see the engine repo’s docs/agent-guides/ and docs/internals/mvcc/.