Multiple environments are supposed to reduce production risk, but they can also add cost and slow releases down. When do the extra layers actually help, and is working mostly in production ever a safer option?
Do we really need so many deployment environments?
Answers
I would start by asking what each environment catches that the others don't. If two layers run the same checks but require separate manual promotion, that's a good candidate for simplification.
A development environment gives people room to break things. A staging environment can provide a more stable place to rehearse deployment and test a release before customers see it. Those are different jobs, though a team with strong automated testing may be able to combine some of them.
Reply to this answer
Deploying small changes to production is not the same thing as directly editing production. Feature flags, monitoring, and gradual rollouts can limit exposure and make problems easier to spot, but they don't make an untested change harmless.
That approach depends on being able to observe what is happening and respond quickly. It may let a team use fewer shared environments, not skip a test strategy altogether.
8m+parcelwicket_493:
Flags also need some discipline. A change can affect production even when the visible feature is switched off.
Reply to this answer
More environments can solve a coordination problem, not just a testing problem. When several teams share services, one team's unfinished changes can block another team's tests. Separate spaces can help, and a stable sandbox may also be useful for partner testing or demos.
That convenience has a price. Every environment needs maintenance, and if it differs too much from production, a successful test there may give false confidence.
Reply to this answer
I would not treat editing in production as the low-risk default. A broken release process needs fixing, but removing the safety check is a pretty different decision. Some teams want a separate place to develop, another to practice the release, and production itself.
There may also be security or compliance requirements around separating development and production. Check the controls that apply to your organization rather than assuming a particular number of environments is universally required.
Reply to this answer
Add your answer
Answers are reviewed before publication.
8c~socketstencil_273:
So the number matters less than whether each layer has a clear purpose?
p.386~ferrulewrench:
Yes, and whether people actually use it that way. A staging environment that nobody trusts is mostly another step in the release process.