# How can I safely change a database schema while my app is running?

Canonical URL: https://help.iagenify.com/faqs/databases/how-can-i-safely-change-a-database-schema-while-my-app-is-running

[← Back to Databases FAQs](https://help.iagenify.com/faqs/databases)

HELP CENTER · FAQ Databases 1 min read
# How can I safely change a database schema while my app is running?
Use an incremental migration that keeps old and new application versions compatible during rollout. Separate adding a structure, moving or backfilling data, switching application reads and writes, and removing obsolete structures into observable steps.
IaGenify
Databases

## Expand before switching
Start with additive changes, such as a nullable column, a new table, or an index created using the database's supported online method. Deploy code that can tolerate both the old and new schema before relying on the new field.
Backfill existing rows in bounded batches, monitor database load, and make the job resumable. Avoid one large transaction that holds locks for a long time or creates a sudden spike in replication lag.
## Contract after verification
Once all running application instances use the new structure, verify data consistency and monitor errors before removing old columns or constraints. Keep the compatibility window long enough for delayed jobs and rollback procedures.
Test the migration against production-like data volume and define a recovery plan. A rollback of application code may not reverse a destructive schema change, so preserving old data or using a forward repair can be safer. [← Back to Databases FAQs](https://help.iagenify.com/faqs/databases)
