Orchestration contracts

Interfaces for MSR components that coordinate database adapter capabilities.

Table of contents

  1. Backup orchestration
  2. Schema version orchestration
  3. Locking orchestration
  4. Relationship to adapter providers

Backup orchestration

IBackupOrchestrator describes MSR’s configured backup lifecycle. BackupOrchestrator wraps the adapter’s IBackup implementation with backup configuration and logging.

Its public operations are backup(), restore(backupPath?), and deleteBackup(). Supply a custom implementation through the backupOrchestrator runner option when the built-in orchestration is not suitable.

Schema version orchestration

**ISchemaVersionOrchestrator** describes the core wrapper around an adapter's **ISchemaVersion** implementation. **SchemaVersionOrchestrator** initializes and validates the version table, then delegates record operations to the adapter.

Its operations are init(tableName), save(details), getAllMigratedScripts(), and remove(timestamp).

Locking orchestration

ILockingOrchestrator is implemented by **LockingOrchestrator**. The core orchestrator uses an adapter's **ILockingProvider** and adds retries, ownership verification, hooks, and logging.

Its public operations are acquireLock(runnerId), releaseLock(runnerId), getLockStatus(), forceReleaseLock(), checkAndReleaseExpiredLock(), initLockStorage(), and ensureLockStorageAccessible().

Adapters provide database-specific operations through ILockingProvider; they do not implement the core orchestration contract.


Relationship to adapter providers

Provider contracts describe capabilities an adapter supplies. Orchestrator contracts describe MSR coordination around those capabilities. Internal Service classes contain MSR business logic. MigrationRollbackManager remains a manager because it coordinates version-targeted rollback behavior.