liveBook · Manning

Immutability

As explained in Grokking Software Architecture

Immutability is a system property in which deployed infrastructure is not modified in place but replaced with a new version when changes are required.

Immutability means replacing deployed infrastructure instead of changing it in place. Like an immutable object, a server is replaced with a new version when it needs an update; logging in to patch a live server is the mutable approach to avoid. section 9.8.1 section 9.8.3

Replacing servers brings practical benefits:

  • Consistent environments: build staging and production from the same blueprint to prevent configuration drift. section 9.8.3
  • Simpler rollbacks: reroute traffic to the previous frozen server instead of hurriedly undoing changes. section 9.8.3
  • A breached server’s installed backdoor disappears when that server is destroyed and rebuilt. section 9.8.3

Patch the version, not the server

If a security patch is needed, don’t log in to the live server and install it. Build a new server with the patch, then replace the old one. This avoids leaving behind undocumented changes. section 9.8.1

There is an important boundary: application servers should be stateless and immutable, but live databases hold persistent customer data. They cannot simply be destroyed and rebuilt for an operating-system patch; their changes require care. section 9.8.3

How Grokking Software Architecture covers it

How deep it goes
Explains the principle, operational benefits, and database exception without detailing a deployment implementation.
Examples
Uses manually patched servers, immutable objects, server rollbacks, and rebuilt servers to illustrate the principle.
What it assumes
Introduces the mutable-versus-immutable distinction through var, let, const, and readonly examples.
What you can do after
Apply it by rebuilding patched application servers and rerouting traffic to earlier frozen versions for rollback.
How it connects
Connects infrastructure immutability to Infrastructure as Code, configuration drift, load balancer rollbacks, and stateless application layers.

Also explained in

Compare how 4 books explain immutability →

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.