#snapshot #spacetime-db #state #low-level #interface #capturing

spacetimedb-snapshot

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

6 releases (unstable)

new 1.0.0-rc1 Nov 6, 2024
0.12.0 Oct 4, 2024
0.11.1 Sep 2, 2024
0.11.0 Aug 6, 2024
0.10.1 Jun 28, 2024

#2185 in Database interfaces

Download history 3/week @ 2024-07-24 86/week @ 2024-07-31 56/week @ 2024-08-07 12/week @ 2024-08-14 7/week @ 2024-08-21 130/week @ 2024-08-28 35/week @ 2024-09-04 30/week @ 2024-09-11 17/week @ 2024-09-18 23/week @ 2024-09-25 180/week @ 2024-10-02 24/week @ 2024-10-09 8/week @ 2024-10-16 5/week @ 2024-10-23

225 downloads per month
Used in 4 crates (via spacetimedb-core)

Custom license

35KB
462 lines

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.

Dependencies

~16–27MB
~434K SLoC