Git Branching Strategy: Trunk-Based vs GitFlow for Teams
Trunk-based development or GitFlow? Compare Git branching strategies for outsourced and offshore teams, with a decision table and rules that keep releases safe.
How to change a live database schema safely: the expand and contract pattern, backfills, rollback plans and what to ask your outsourced team to do.
Most teams get application deployments under control long before they get database changes under control. A new release can be rolled back in minutes, but a schema change that has already rewritten a table cannot. That asymmetry is why database migrations cause a disproportionate share of release-day incidents, and why they are worth planning deliberately, especially when your product has users in several time zones and there is no quiet hour to hide in.
This guide explains how product teams can change a live database without taking the application offline, and what to expect from a development partner who does this work for you.
Three problems account for most failures:
Every safe-migration technique below is a way of dealing with one of these three.
The core idea is to split one risky change into several small, individually safe ones. Suppose you want to rename a column from fullname to display_name. A single rename breaks any running code that still uses the old name. Instead:
display_name, nullable, without touching the old one.It takes more steps than a rename, but each step can be deployed and reversed independently, and the application stays up throughout.
The exact behaviour depends on your database engine and version, so always check its documentation and test on a copy of production data. As a general guide:
| Change | Usually safe? | What to do |
|---|---|---|
| Add a nullable column | Yes | Deploy directly |
| Add a column with a default | Depends on engine and version | Test first; otherwise add nullable, then backfill |
| Add an index | Risky on large tables | Use your database’s online or concurrent index option |
| Rename a column or table | No | Use expand and contract |
| Change a column type | No | Add a new column, backfill, switch, drop |
| Drop a column or table | Risky | Remove all code references first, drop in a later release |
| Add a NOT NULL constraint | Risky | Backfill first, then add the constraint |
Copying millions of rows in one transaction is a classic way to overload a production database. A safer backfill:
Migrations should be code, stored in version control, reviewed like any other change and applied by your CI/CD pipeline rather than by someone typing commands into a production console. Good habits include:
Pairing these habits with feature flags, covered in our feature flags guide, lets you switch behaviour on and off without redeploying, which makes the read and write switches in expand and contract much less stressful. For the deployment side of the same problem, see zero-downtime deployment strategies.
If development is outsourced, put these expectations in the statement of work or the team’s definition of done:
Plan for extra care when a table holds tens of millions of rows or more, when you are changing database engines, when you must keep two systems in sync during a move, or when regulation limits how data may be altered or moved. These are projects in their own right, not tasks to squeeze into a sprint.
Safe migrations are mostly discipline: small steps, rehearsal, monitoring and a clear way back. Our cloud and DevOps services cover pipeline automation, environment setup and release practices that make database changes routine rather than risky. If you are planning a schema overhaul, a platform move or a stalled release process, get in touch and we will review your current approach and suggest a safe path forward.
Trunk-based development or GitFlow? Compare Git branching strategies for outsourced and offshore teams, with a decision table and rules that keep releases safe.
Monorepo or polyrepo? Compare code repository strategies for web, mobile and backend products, with a decision table and tips for outsourced teams.
How to version and retire APIs without breaking clients: versioning options, breaking-change rules, sunset policies and a checklist for outsourced teams.
Tell us about your platform, your product idea or the systems you want to modernise. Someone from our Chennai engineering team will get back to you personally.