← Lessons

quiz vs the machine

Gold1430

System Design

Immutable Infrastructure

Replacing servers instead of modifying them to avoid configuration drift.

4 min read · core · beat Gold to climb

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.

Check yourself

Answer to earn rating on the learn ladder.

1. How do you make a change in immutable infrastructure?

2. What problem does immutable infrastructure mainly prevent?