The Environment Problem
Local works. Staging breaks. Production is different again. Environments are one of the most persistent sources of friction in software delivery, and most teams are solving them the hard way.
Works on My Machine
There is a reason this phrase became a running joke in software development. It captures something real: the environment a piece of software runs in shapes how it behaves, and keeping those environments consistent is hard.
The typical setup looks something like this. Developers run something locally: a mix of services running directly on their machine, some mocked, some pointed at a shared development database. There is a staging environment that roughly resembles production, but it was last updated six months ago and has picked up configuration drift that nobody has fully documented. There is production, the only environment that actually matters and the one everyone is most afraid to touch. And somewhere in between there might be a QA environment the testing team shares, a UAT environment for client sign-off, and a handful of ad-hoc environments that someone spun up for a demo and never cleaned up.
Each of these has a slightly different configuration, a slightly different version of the infrastructure, and a slightly different set of assumptions baked into the deployment scripts. The further a change travels along this chain, the more chances it has to behave differently from what was tested.
The Root Causes
Environment problems come from a few consistent sources.
Configuration drift. Every manual change to an environment (a config value adjusted, a dependency updated, a firewall rule added) moves it away from the intended state. Over time, environments that started out identical develop their own personalities. Staging starts behaving in ways production doesn’t. Bugs show up in one and not the other, and nobody knows exactly when or how the environments diverged.
Shared environments. Every developer on the team uses the shared staging environment at the same time. Two engineers testing different features interfere with each other’s work, and a broken deployment from one branch blocks everyone else from testing. Parallel development ends up as sequential testing.
Parity gaps. Local development environments are almost never identical to production. They run on a different operating system, use a different database version, skip infrastructure components that are too complex to run locally, and mock things that are real in production. The further local is from production, the less you can trust local testing.
Promotion friction. Moving a change from one environment to the next, from development to staging and from staging to production, often involves manual steps, environment-specific configuration, and a chain of handoffs that add both delay and risk. The process differs enough between environments that it introduces failure modes of its own.
Branch Environments: The Obvious Solution Nobody Has Made Easy
The natural answer to shared environment problems is to give each branch its own environment. A feature branch gets a full deployment of the application stack, pointed at its own isolated data, available for testing without affecting anyone else. When the branch is merged, the environment is torn down.
This is clearly the right model. It makes real parallel development possible: teams can work independently, test in realistic conditions, and get feedback without coordinating around a shared resource.
Most teams don’t do it because it is expensive to set up and expensive to run. Spinning up a full environment for every branch needs infrastructure that supports it, tooling to automate it, and a cost model that doesn’t make it prohibitive. For most teams, creating and maintaining branch environments costs more than coordinating around a shared staging server.
So teams share staging. Developers wait for each other, and bugs slip through because the test environment wasn’t clean. Everyone knows the better solution, but it stays too costly to implement.
Propagation Between Environments
Even when environments are well managed, promoting changes between them is often where things break.
The ideal model is simple: a change that passes in one environment should be deployable to the next without modification. The environment changes, the application doesn’t. If production needs different configuration from staging (different secrets, different endpoints, different scaling parameters), that belongs in the environment definition, not in the deployment artefact.
In practice it rarely works this way. Configuration is often baked into build artefacts. Deployment scripts have environment-specific branches. Getting something from staging to production involves a checklist of manual steps that someone has to remember to follow in the right order.
That leads to a specific failure mode: something works perfectly in staging and breaks in production, not because of a bug in the code but because it was deployed differently. The fix is a hotfix rather than a code change, and the root cause is that the environments were less alike than they looked.
What Well-Designed Environments Look Like
An environment model that actually works has these characteristics:
Environments are defined, not accumulated. The entire configuration of an environment (providers, infrastructure topology, access controls, scaling parameters) is a definition that can be version-controlled, reviewed, and reproduced. Manually changing live environments is not part of the normal workflow.
Parity is built in, not hoped for. Local, staging, and production run the same application code, the same communication model, and the same execution environment. Only configuration differs between them: which provider they run on, which data stores they point at, what scaling limits apply. The application doesn’t know or care which environment it is in.
Branch environments are cheap to create and clean up automatically. Creating an environment for a feature branch takes one command or none. It inherits the environment definition from the parent branch, and when the branch is merged or closed, the environment is removed automatically. Parallel development needs no coordination.
Promotion is a configuration change. Deploying to production means applying the production configuration to the same application artefact that was tested in staging. There are no environment-specific build steps, no manual configuration differences, and no deployment scripts that behave differently depending on the target. If it worked in staging with the staging configuration, it will work in production with the production configuration.
Sub-environments isolate features within a shared environment. Some teams need shared resources, such as a shared integration environment or a shared demo environment. The environment model should support isolated sub-environments per application or per branch inside that shared context, so teams share the deployment target without sharing state.
The Cost of Getting This Wrong
Environment problems are a tax on every team that has them, but the cost is spread out and hard to see. Developers wait for staging to become available. QA blocks releases because the environment isn’t in a clean state. Incidents are caused by configuration differences that testing never caught. Time goes into debugging issues that turn out to be environment problems rather than code problems.
None of this shows up as a line item. It shows up as slower velocity than there should be, releases that are more stressful than they need to be, and bugs that reach production because the code was tested under different conditions from the ones it ran in.
Getting environments right makes everything else the team does faster.
Want to follow our progress?
We're onboarding early design partners and sharing what we learn.
Get Early Access