Skip to main content

Overview

A snapshot is the derived, evaluation-ready document for one environment. Postgres owns definitions; KV holds only this blob. SDKs never see audit logs, secrets, tags, or managedBy.

Shape

version is environment.snapshot_version — monotonic per environment, independent of per-flag versions.

How it gets there

  1. Control-plane mutation + audit commit
  2. snapshot_outbox row
  3. Materialize → KV snapshots/{environmentId}/current.json
  4. Notify ws-gateway (snapshot.updated)
  5. Mark outbox processed
Failed KV/notify leaves the outbox pending. Retry with shipd snapshots publish or wait for the drain interval.

SDK rules

  • Fetch current snapshot only (no replay of versions 11–14 if you jumped 10 → 15)
  • Ignore HTTP bodies with version < local (no rollback)
  • After notify, retry while version < notified (KV lag), then keep last good
  • Unsupported schemaVersiononError, keep last good
ETag: "snapshot-<version>". Send If-None-Match to get 304.

Next