Immutable Infrastructure
Never patch running instances; build a new image and replace them.
Detailed Description
This way, what runs in production is exactly the thing your build system built and tested - not a server somebody has since edited.
Going back means deploying the previous image again, rather than trying to remember and undo what you changed on a server.
Never log into a running server to patch it by hand. Build a new image and replace the server - otherwise every machine slowly becomes slightly different.
Pair with GitOps or declarative deployment pipelines so desired state and runtime state stay aligned.
Treat runtime as disposable: build once, promote through environments, and replace predictably.
Visual Diagram
Mutable (old way) Server → SSH in → apt update → patch (drift: servers become snowflakes) Immutable (correct) Code change → build new Docker image → push to registry → deploy new pods → terminate old pods Every deployment is predictable
Tradeoffs
Predictable deployments, no configuration drift
Requires strong build and release pipeline
Comments
Sign in to leave a comment. Your name and photo come from Google; nothing else is shared.
Loading comments...
AI
System Design
Backend
- GraphQL8 modules · 69 lessons planned
- Core Python13 modules · 75 lessons planned
- FastAPI5 sections · 20 lessons
- Node.js14 modules · 206 lessons planned
- Node.js Performance7 chapters · 36 topics
- Event Loop Lifecycle6 phases · 3 scenarios
- Docker & Containerization11 modules · 144 lessons planned
- AWS for Developers14 modules · 219 lessons planned
- CI/CD & DevOps Automation10 modules · 134 lessons planned