Skip to content

Storage and recovery internals

Only the creating process and creating thread may use or close a database handle; inherited handles cannot be used after fork(). Database-path symlinks and hard links are rejected. Parent-directory aliases still refer to the same lock-file inode. Do not delete or replace a held .lock, alias the sidecar files, or mutate database files outside the engine. This preview assumes a private, trusted local filesystem namespace.

A process obtains exclusive ownership of a database. The public API is thread-affine; concurrent readers, multiwriter operation, and Windows support are not claimed.

Snapshot files use the RPSNAP2 version-2 format with sequence and CRC metadata. Each changed-row transaction is represented by two identical checksummed copies in the .wal file. Both copies are synchronized before the in-memory state is published. This is redo redundancy in one log, not independent physical replication.

Checkpointing writes and synchronizes a full snapshot, atomically renames it, and synchronizes the parent directory before truncating and synchronizing the log. An incomplete, unacknowledged tail is discarded during recovery; a complete transaction whose two copies are corrupt is rejected. An uncertain write poisons the writer. Recovery is bounded to 64 MiB per snapshot and WAL.

These mechanisms are implementation behavior, not broad recovery qualification. Failure tests and platform review remain in progress; filesystem sync and process tests do not establish physical power-loss safety. No existing-format compatibility is promised.

The source change-set implementation stages row-local effects instead of cloning the full map. Commit preparation encodes the final effects before durable I/O; after the duplicated redo is synchronized, publication applies the prepared changes without allocation. Recovery validates and prepares each frame, then replays only its row effects rather than copying unrelated rows. The API and on-disk framing are unchanged. These mechanisms improve the shape of transaction staging and replay; they do not establish general performance or production readiness.

The package-performance campaign compares the actual Python package with prepared SQLite across six cells. Read the canonical measured results and reproduction guide. Provenance identifies locally built wheels carrying 0.1.1 metadata; these are neither published PyPI 0.1.1 wheels nor a 0.1.2 package artifact. The historical 2× SQLite target is retired. In that comparison, the 1,000-row singleton-update, 1,000-row batch-update, and 10,000-row singleton-update cells are below 2×. The 10,000-row batch cell exceeds 2×, and the two point-read cells exceed 2×, but those scoped wins do not establish a general advantage.

Historical random-update results are separate: the 3.04–5.95× result belongs only to its audited experimental harness, not the Python package, and its reopen comparison remains 16/16 losses. See the recommendation, roadmap, historical methodology, and package-performance guide.

The API and storage format are experimental. There is no production durability guarantee; physical power-loss safety, broad cross-platform behavior, concurrent readers, multiwriter use, Windows, ORM, and SQLite SQL/file/C API compatibility are unsupported. A distinct SQL preview with optional bounded whole-model persistence is documented separately; it does not alter this API or its storage behavior.

Download this page as Markdown