#spacetime-db #snapshot #state

spacetimedb-snapshot

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

12 releases (3 stable)

new 1.1.0 Apr 16, 2025
1.0.1 Mar 25, 2025
1.0.0 Feb 28, 2025
1.0.0-rc2 Dec 13, 2024
0.10.1 Jun 28, 2024

#1990 in Database interfaces

Download history 2/week @ 2025-01-03 80/week @ 2025-01-10 23/week @ 2025-01-17 96/week @ 2025-01-24 16/week @ 2025-01-31 9/week @ 2025-02-07 4/week @ 2025-02-14 6/week @ 2025-02-21 183/week @ 2025-02-28 85/week @ 2025-03-07 15/week @ 2025-03-14 100/week @ 2025-03-21 34/week @ 2025-03-28 23/week @ 2025-04-04 118/week @ 2025-04-11

276 downloads per month
Used in 3 crates (via spacetimedb-core)

Custom license

69KB
1K 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

~23–36MB
~585K SLoC