---
library: "bootstrap"
slug: "StateSnapshot"
name: "StateSnapshot"
ref: "StateSnapshot#d757"
hash: "sema:StateSnapshot#mh:SHA-256:d75752f332fe14ae3abf2253a45ab180034d2becc3a7e19e3e30da3c94b3c636"
type: "Primitives"
layer: "Infrastructure"
version: "0.11.0"
root: "a6a3d1ff0f982ee30430c5b42f3784c8ec901fd68482cfc1bc30899c1e5e48c5"
license: null
url: "https://semahash.org/vocabularies/bootstrap/patterns/StateSnapshot"
---

# StateSnapshot

Durable persistence of volatile state

Infrastructure · Primitives

## Mechanism

Periodic serialization of internal volatile [State](https://semahash.org/vocabularies/bootstrap/patterns/State.md) to durable storage to enable crash recovery. Unlike distributed checkpoints (which requires consensus), [Snapshot](https://semahash.org/vocabularies/bootstrap/patterns/Snapshot.md) is a local or unilateral durability guarantee. It enables 'Resume' functionality. Utilizes [Trace](https://semahash.org/vocabularies/bootstrap/patterns/Trace.md), [IdempotentWrite](https://semahash.org/vocabularies/bootstrap/patterns/IdempotentWrite.md).

## Invariants

- Atomicity: [Snapshot](https://semahash.org/vocabularies/bootstrap/patterns/Snapshot.md) is either fully written or discarded (no partial corruption)
- Roundtrip Integrity: Deserialize(Serialize(S)) must equal S

## Signature

- State(Snapshot)

## Preconditions

- Serializable [State](https://semahash.org/vocabularies/bootstrap/patterns/State.md)
- Write access to durable storage

## Postconditions

- Resume point established

## Where this came from

—

## Builds on

- [Snapshot](https://semahash.org/vocabularies/bootstrap/patterns/Snapshot.md) (references)
- [State](https://semahash.org/vocabularies/bootstrap/patterns/State.md) (references)
- [IdempotentWrite](https://semahash.org/vocabularies/bootstrap/patterns/IdempotentWrite.md) (references)
- [Trace](https://semahash.org/vocabularies/bootstrap/patterns/Trace.md) (references)

## Used by

- [FractalIntelligence](https://semahash.org/vocabularies/bootstrap/patterns/FractalIntelligence.md) (composes_with)

## Identity

- Library: bootstrap 0.11.0 (root a6a3d1ff0f98)
- Ref: StateSnapshot#d757
- Hash: sema:StateSnapshot#mh:SHA-256:d75752f332fe14ae3abf2253a45ab180034d2becc3a7e19e3e30da3c94b3c636

## Links

- Page: https://semahash.org/vocabularies/bootstrap/patterns/StateSnapshot
- JSON: https://semahash.org/vocabularies/bootstrap/patterns/StateSnapshot.json
- Library: https://semahash.org/vocabularies/bootstrap
- Library index: https://semahash.org/vocabularies/bootstrap/index.json
