liveBook · Manning

Immutable infrastructure

As explained in Grokking Software Architecture

An operational approach in which deployed infrastructure is changed by rebuilding and replacing instances rather than modifying them in place.

Immutable infrastructure treats deployed servers or containers like constants: once live, they are not patched or tweaked. Instead, change the blueprint, build a replacement, move traffic to it, and remove the old instance. It is the printed-flyer approach to server updates: fix the source, then replace the copies. section 9.8.2 section 9.12

For a server that needs a security patch:

  • Update the Terraform configuration or Dockerfile. section 9.8.2
  • Build and deploy a fresh, patched replacement; check that it works. section 9.8.2
  • Route traffic to the replacement, then destroy the old instance. section 9.8.2

Blue-Green Deployment names this switch: keep the old Blue environment available while verifying Green, then redirect traffic. If the new version fails, switch back. Rebuilding avoids configuration drift and makes rollback straightforward; frequently replacing instances can also remove malicious changes. Stateful databases are an exception: their persistent data requires careful change management. section 9.8.2 section 9.8.3

Figure 9.6 The Immutable Deployment Pipeline. Instead of patching live servers, we build a fresh Server Image from our code, deploy a new instance, automatically verify its health, seamlessly swap the user traffic at the Load Balancer, and finally destroy the old infrastructure.

See the deployment sequence: build a fresh image, verify the new instance, switch traffic at the load balancer, and remove the old infrastructure. section 9.8.2

How Grokking Software Architecture covers it

How deep it goes
Defines immutability, details the replacement pipeline, and explains drift, rollback, security benefits, and the database exception.
Examples
Uses a security-patch scenario, printed-flyer analogy, and Blue-Green traffic switch with rollback.
What you can do after
Operate a deployment pipeline that builds a patched replacement, verifies it, shifts traffic, and removes the old instance.
How it connects
Links infrastructure as code, configuration drift, Blue-Green deployment, load balancers, and stateful databases.

Also explained in

Compare how 2 books explain immutable infrastructure →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking Software Architecture. The section links point to the parts of the book it draws on.