Have you ever found that your Dev, Test, and Production environments are not consistent over time? Or ever tried to track downa bug that was specific to an environment and could not be reproduced anywhere else? How do you ensure consistency across all environments so that your testing is reliable?
Most teams today release new versions of their application by upgrading their servers. However, this often leads to ad-hoc changes made to a subset of servers or a single environment just to make the application work after server upgrade.
However, this often leads to configuration drift as ad-hoc modifications are hard to track and apply consistently across all servers. Ultimately, drift leads to deployments that are not always repeatable and consistent. Also, tracking down pesky environment specific bugs becomes impossible since nobody knows exactly what is unique about each environment.
The Immutable Server pattern addresses the configuration drift problem by stating that a Server, once deployed, should never be modified. It is only replaced with a new instance updated with the newer version of the machine image. Read more about Immutable Servers.
To adopt immutable servers, your DevOps pipeline should include building the base AMI, which triggers a rebuild of the application AMI each time the base AMI changes, which in turn triggers a deployment and the rest of your Continuous Delivery workflow. When the application and all infrastructure config is baked into the machine image, it addresses drift issues since no ad-hoc changes are ever applied to a subset of servers. All machines are always consistent, leading to predictable release and a better night's sleep for everyone involved.