ADR 0002: Isolation, browser floor, packaging, results, collation, performance targets
- Status: accepted
- Date: 2026-10-31
Decisions
- Isolation: snapshot isolation with a single writer (as in SQLite WAL mode). Serializable isolation is out of scope.
- Minimum browsers: Chrome/Edge 108, Firefox 111, and Safari 17. The baseline must work with only these features. Future option: feature-detected fast paths for newer browsers (e.g.
readwrite-unsafesync handles for multi-handle reads, JSPI, newer OPFS APIs). The VFS and worker layers must expose capability flags so these can be added without changing the format or the API. - Packaging: the library spawns its own worker through
new Worker(new URL('./worker.js', import.meta.url), { type: 'module' }), a form Vite, webpack 5, esbuild, and Rollup all handle. Apps can override it withworker: URL | string | Worker. - Results: the wire is always columnar with transferable buffers.
query()returns an array of objects by default.rowMode: 'array' | 'columnar'is available. Rationale: research/result-shape-benchmark.md. - Collation: SQLite built-ins only:
BINARY(default),NOCASE(ASCII), andRTRIM. Locale-aware collation is a possible future extension. - Performance: aggressive targets. smaltdb must beat SQLite WASM (OPFS VFS) on every benchmark workload, and it must be competitive with DuckDB-WASM on analytical workloads up to 1 GB. PGlite is also a baseline. See PERFORMANCE.md.
Consequences
- No read-set tracking is needed. Write conflicts cannot happen because there is a single writer.
- The comparable-key encoding for
BINARYandNOCASEcan be computed byte-wise, with no ICU dependency. - The benchmark harness, with all three competitors, must exist from M0 so that every milestone is measured against them.