State-Based Database Deployments for MySQL

Replace hand-written SQL migrations with version-controlled state declarations. Deploy with confidence to MySQL, every time.

SchemaSmith development cycle for MySQL: declare schema, deploy with SchemaQuench, verify state.

The Better Way to Manage MySQL Schema

Script-Based Migrations

  • Fragile dependencies — each ALTER script bets on the exact current state of the database
  • Procedural diffs — reviewers read "add column, drop index, rename constraint" instead of schema design
  • Broken chains — one failed script blocks everything downstream
  • Drift gets buried — out-of-band changes hide in tickets, not tracked in code
  • Re-execution risk — manually re-running a script can corrupt data or create duplicates

State-Based with SchemaSmith

  • Declare the destination — define what your tables, views, stored procedures should look like
  • Automatic delta detection — SchemaSmith computes the correct DDL from your declaration
  • Independent deployments — each database converges to match your declaration, no ordering worries
  • Full audit trail — source control tracks every schema change, when, and by whom
  • Idempotent runs — deploy the same package to dev, staging, and production with identical results

From Database to Deployment in Three Steps

1. Extract

SchemaTongs grips your live MySQL database and casts every object into a clean, version-controlled package — tables as JSON, stored procedures and views as SQL scripts, organized and ready for source control.

2. Version & Review

Commit your schema package to source control. When a developer modifies a table JSON file or adds a stored procedure, the DBA reviews the actual design, not a procedural script. Pull requests become schema reviews.

3. Deploy

SchemaQuench reads your declared schema, connects to the target server, and applies only the changes needed. Run it against dev, staging, and production — same package, correct results every time.

MySQL-Specific Capabilities

Dependency Handling

MySQL's constraint, index, and foreign key dependencies can trap you into manual reorganization. SchemaSmith computes and executes the correct drop-and-recreate sequence automatically. Rename a column? Indexes, constraints, and foreign keys follow. No script archaeology required.

Drift Detection & Correction

Production databases drift. Someone modifies a table outside the deployment pipeline, an emergency index gets added, a stored procedure gets altered manually. SchemaSmith compares your declared state against the live database on every run and corrects drift — no guessing what changed.

Multi-Database Deployments

SaaS teams running the same schema across dozens of customer databases can deploy in parallel. SchemaQuench targets multiple databases at once and converges them all to the declared state in a single run. One schema package, many targets, completely repeatable.

CI/CD Integration

SchemaSmith integrates with Azure DevOps, GitHub Actions, GitLab CI, Jenkins, and TeamCity as command-line steps. Self-contained executables and XCOPY deployment mean no installer or runtime to manage. Pre-install on a self-hosted runner and reference SchemaQuench from any pipeline.

Resume Failed Deployments

Long MySQL deployments can fail mid-run due to transient network blips, lock timeouts, or a migration script hitting bad data. SchemaQuench writes a checkpoint after each completed step — tables, migrations, objects — each one tracked individually. On the next run, pass --ResumeQuench and SchemaQuench skips everything already completed and picks up at the first incomplete step. Checkpoints auto-delete after a successful run, so there's no residue to mislead the next deployment.

FK-Aware Data Delivery

Reference data with foreign-key dependencies creates a load-order problem: insert rows in the wrong sequence and the insert fails on the constraint. DataTongs with --ConfigureDataDelivery writes a DataDelivery block into each table's JSON file, capturing the data file, merge type, and match columns needed to apply it. SchemaQuench reads those blocks at deploy time and delivers data in two passes, handling circular relationships and complex dependency graphs without hand-coded ordering scripts.

Supported MySQL Versions

  • MySQL 8.0 and higher

SchemaSmith vs. Other MySQL Tools

See how state-based schema management compares to migration scripts, Liquibase, and other approaches.

Learn More

Dive deeper into schema-as-code patterns, deployment strategies, and real-world MySQL scenarios.