r/devops • u/InnerBank2400 • Aug 08 '26
Discussion When does “just rebuild it” stop being safe?
I am looking for practitioner views on a lifecycle problem, not a code review.
In many teams, temporary environments are treated as disposable until they quietly become important. They accumulate state, access paths, recovery assumptions, cost exposure and operational evidence. Then teardown becomes risky, but leaving them running also creates waste.
I built an open-source implementation that treats readiness, dependency order, access, health checks, cost visibility, state preservation and teardown as one runtime contract.
The question I am trying to validate is simple:
What evidence should exist before a system is allowed to destroy or rebuild an environment that may contain useful state?
If you have dealt with ephemeral environments, recovery runs, lab platforms or image lifecycles, I would value a short sanity check. I can share the relevant paper and GitHub discussion.
NOTE: I am not asking for code review or implementation help. I am trying to sanity-check one operating-design question.
15
u/onbiver9871 Aug 08 '26
My instinct is that I think the type of state you’re questioning is usually pretty domain specific and probably a bit hard to operationally generalize…?
Having built sandbox environments, the onus is usually on the consumer to understand that any state they accumulate is not to be trusted in terms of persistence.
6
u/Dry-Application9003 Aug 08 '26
Terraform/OpenTOFU, Ansible, containers, bash installers: the whole industry has moved away from "stateful" environments. You have IaC and config files defining an end state with .env files, and persistent volumes and databases in some cases where you accrue data (those you have a process for backup), and everything else is "rebuild whenever" with idempotency.
So, if I got you correctly, the problem you are putting forth has already been solved for years by being avoided altogether. In short, in any situation imaginable, wiping a computer or a server should result in nothing more than downtime, no matter what is wiped or when, and not because you have a contingency for everything, but rather, by design.
7
u/omgseriouslynoway Aug 08 '26
If you can't tear it down and rebuild it safely then your code is wrong. Fix it.
3
u/lavahot Aug 08 '26
This isn't something you can build because by the time you figure out that something is too useful to destroy, it's too late to destroy it. That's tech debt. It happens all the time. People don't even realize they are creating tech debt. This is a thing that you solve with good practice, not with a framework.
1
u/ride_whenever Aug 09 '26
This really feels like an a-b problem. This is absolutely a real issue, but the answer is pretty much always don’t allow them to run long enough to accumulate anything that actually matters, and let the lost work be the stick.
Most teams only make the mistake once or twice before building the assumption that they’re transient into their workflow
1
u/[deleted] Aug 09 '26
[removed] — view removed comment
1
u/[deleted] Aug 11 '26
[removed] — view removed comment