2 min read | by Jordi Prats
Immutable infrastructure is a method of managing infrastructure where resources are replaced, rather than modified. Being able to create new instances easily, servers become disposable: cattle, not pets.
The main benefit of immutable infrastructure is that it makes it much easier to scale it: Since resources are replaced instead of modified, there is less risk of configuration drift and fewer manual steps required to make changes. This makes it easier to automate the underlying infrastructure to roll out changes quickly and consistently. Besides, because new resources are created from a known good state, it is less likely that problems will occur in the first place.
Furthermore, this is going to makes it easier to recover from failures: As long as changes are versioned in some way, tt is much easier to roll back to a previous state if something goes wrong.
From the security and compliance perspective, replacing resources instead of modifying them, allows us to ensure that all resources conform to the standards we have defined (no configuration drift).
Although it can be implemented in many different ways, the more common tools that will allow us to implement immutable infrastructure, defining the infrastructure in a declarative way are: terraform, ansible or CloudFormation (there are several tools for it, such as sceptre).
To sum it up, immutable infrastructure is a method of managing infrastructure where resources are replaced, rather than modified.
Posted on 24/01/2023