#spacetime-db #state #commit-log #low-level-interface #on-disk-format #restoring-snapshot

spacetimedb-snapshot

Low-level interfaces for capturing and restoring snapshots of database states

16 releases (7 stable)

1.3.0 Aug 1, 2025
1.2.0 Jun 17, 2025
1.1.2 May 9, 2025
1.0.1 Mar 25, 2025
0.10.1 Jun 28, 2024

#3 in #commit-log


Used in 4 crates (2 directly)

Custom license

83KB
1.5K SLoC

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.

⚠️ Internal Crate ⚠️

This crate is intended for internal use only. It is not stable and may change without notice.

Dependencies

~31–51MB
~744K SLoC