Crate spacetimedb_snapshot

Crate spacetimedb_snapshot 

Source
Expand description

This crate implements capturing and restoring snapshots in SpacetimeDB.

A snapshot is an on-disk view of the committed state of a database at a particular transaction offset. Snapshots exist as an optimization over replaying the commitlog; when restoring to the most recent transaction, rather than replaying the commitlog from 0, we can reload the most recent snapshot, then replay only the suffix of the commitlog.

This crate is responsible for:

This crate is not responsible for:

  • Determining when to capture snapshots.
  • Deciding which snapshot to restore from after a restart.
  • Replaying the suffix of the commitlog after restoring a snapshot.
  • Transforming a ReconstructedSnapshot into a live Spacetime datastore.

Modules§

remote

Structs§

ReconstructedSnapshot
Snapshot
SnapshotRepository
A repository of snapshots of a particular database instance.
SnapshotSize
Collect the size of the snapshot and the number of objects in it.

Enums§

ObjectType
An object which may be associated with an error during snapshotting.
SnapshotError

Constants§

CURRENT_MODULE_ABI_VERSION
ABI version of the module from which this snapshot was created, as [MAJOR, MINOR].
CURRENT_SNAPSHOT_VERSION
Snapshot format version number.
INVALID_SNAPSHOT_DIR_EXT
File extension of snapshots which have been marked invalid by SnapshotRepository::invalidate_newer_snapshots.
MAGIC
Magic number for snapshot files: a point in spacetime.
SNAPSHOT_DIR_EXT
File extension of snapshot directories.
SNAPSHOT_FILE_EXT
File extension of snapshot files, which contain BSATN-encoded Snapshots preceded by blake3::Hashes.