Replace, never patch
Immutable infrastructure means that once a server or container is deployed, you never modify it in place. To make a change you build a brand new image and replace the old instances entirely.
This contrasts with mutable infrastructure, where you log into running servers and apply updates by hand or with config scripts.
The drift problem
Over time, manually patched servers diverge from each other in subtle ways. This configuration drift makes systems hard to reproduce and debug. With immutable infrastructure, every instance built from the same image is identical.
Benefits and costs
- Predictable what you test is exactly what runs in production.
- Easy rollback redeploy the previous image.
- No snowflakes no uniquely hand tuned servers to maintain.
- Cost you must rebuild and redeploy for every change, even small ones.
Immutable infrastructure pairs naturally with containers and golden machine images, where building a fresh artifact is cheap and fast.
Key idea
Immutable infrastructure replaces instances with freshly built images instead of patching them in place, eliminating configuration drift and making deployments predictable and reversible.