Immutable Infrastructure
[Paragraph 1] Immutable infrastructure refers to the practice of deploying infrastructure that remains unchanged over its lifetime. Instead of updating existing servers or virtual machines, new immutable instances are deployed with each change. The key idea is that immutable infrastructure is disposable - servers are replaced rather than changed in-place. This makes infrastructure more consistent and predictable.
[Paragraph 2] For example, let's say you need to deploy a web application. With mutable infrastructure, you would provision a VM, install the web server and app, then continually log in to update the OS, dependencies, and app code. With immutable infrastructure, you would bake a VM image with the OS, dependencies, and app pre-installed. Each time you need to update the app, you deploy new instances from the updated image instead of changing the existing VMs. This ensures consistent infrastructure, avoids configuration drift, and enables easy rollbacks. You treat infrastructure like cattle, not pets - easily replacing instances as needed. Tools like Packer, Docker, and Kubernetes facilitate immutable deployment patterns.