Reliability

Recoverable commits and checkpoints.

TriviumDB records changes in a CRC-protected write-ahead log and replays the safe prefix on startup. Transaction commits validate first, append a TxBegin/TxCommit batch, then apply to memory; checkpoint files are synced and published with atomic rename.

  1. Transaction validationDry-run check IDs, dimensions, payload size, and graph references before a transaction commit.
  2. WAL + CRCEach record is framed as length + bincode + CRC32, so recovery can tell an unfinished tail from real corruption.
  3. Safe-prefix replayReplay complete TxBegin/TxCommit batches and drop an unfinished tail. A corrupted complete frame fails the open and keeps the log intact.
  4. Checkpoint renameWrite temporary checkpoint files, sync them, and publish with atomic rename.
  5. Sync modeWAL flush/fsync strength follows configuration: full, normal, or off.