rocksdb-read-snapshot · shipping · also RocksDB snapshot, GetSnapshot

RocksDB read snapshot

A RocksDB read snapshot is a handle selecting a point-in-time read view within a running database.

Related Observatory article: RocksDB read snapshot on hesela.com

In the same database, set ReadOptions::snapshot to the acquired handle for reads of that view. GetSnapshot can return null; release a successful handle with ReleaseSnapshot when it is no longer needed, and do not reuse it afterward. [1]

The view does not survive database restart. With snapshot-preserving settings, flush and compaction retain versions needed by active snapshots, rather than guaranteeing retention of specific SST filenames. It is not a checkpoint directory or a backup. [2]

With unordered_write=true, pending lower-sequence writes may become visible after acquisition. Application compaction filters can change or remove snapshot-visible data. Both weaken an unconditional immutable-view assumption. [4] [5]

Relations

related
rocksdb-checkpoint, rocksdb-backup-engine, rocksdb-column-family, compaction, lsm-tombstone, snapshot

Citations

  1. RocksDB v10.10.1. db.h: GetSnapshot and ReleaseSnapshot. (accessed 2026-10-17)
  2. RocksDB project. Snapshot: lifetime, read visibility and compaction retention. (accessed 2026-10-17)
  3. RocksDB v10.10.1. options.h: buffering, atomic flush, write policy and snapshot immutability. (accessed 2026-10-17)
  4. RocksDB v10.10.1. compaction_filter.h: snapshot-visible data caveat. (accessed 2026-10-17)

Further reading

  1. Hesela: RocksDB capture and recovery boundaries. (accessed 2026-10-17)
Sources & caveats

JSON: /data/terms/rocksdb-read-snapshot.json