Skip to content

Backends

A backend is the optional place NSchema persists a snapshot of the last applied schema. It’s declared in a BACKEND config block, and it’s what enables:

  • Offline planningplan against the recorded snapshot, with no database connection;
  • Drift detection — comparing the live database against what was recorded;
  • show — inspecting the recorded schema.

A backend is optional: with no BACKEND block, NSchema plans against the live provider every time. See Offline planning & state for when you want one.

BackendPage
Local fileLocal file
Amazon S3Amazon S3

Additional backends (Azure Blob Storage) are planned — see the roadmap.

NSchema locks the backend during write operations (apply, destroy, refresh) so concurrent runs can’t corrupt the recorded state. If a run is interrupted and leaves a stale lock behind, clear it with force-unlock — once you’re sure no operation is still running.

This applies to every backend; the lock lives alongside the state it protects.