elips/docs
Chapter VI · persistence

checkpoint() and compact()

These are the two maintenance verbs. Schedule them; don't pray for them.

  • checkpoint() — writes the current logical state to disk and truncates the WAL
  • compact() — rebuilds each vault index from the record store, then checkpoints

Segmented mode writes one fresh segment per vault, rewrites elips.manifest, and removes obsolete segment files. Snapshot mode writes elips.snapshot.tmp, atomic-renames to elips.snapshot, removes segmented artifacts.

python
db.checkpoint()   # flush + truncate WAL
db.compact()      # rebuild indexes + checkpoint