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 planning. Run
planagainst the recorded snapshot, with out a database connection; - Drift detection. Detect out-of-band changes in your deployed database schema;
- The
state showcommand To inspect 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.
Available backends
Section titled “Available backends”| Backend | Page |
|---|---|
| Local file | Local file |
| Amazon S3 | Amazon S3 |
Locking
Section titled “Locking”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 lock release once you’re sure no operation is still running.
This applies to every backend; the lock lives alongside the state it protects.