How to handle schema migrations when there’s existing data (with minimal downtime)?
- Use migrations scripts with data transformation carefully.
- Apply backward-compatible schema changes first (add columns instead of drop).
- Use feature flags or phased deployment.
- Run migrations during maintenance windows or use rolling updates.