What is immutable infrastructure?
Options
- Servers that can never be rebooted after they start running
- Never patching servers in place: build a new image and replace (Correct option)
- Databases that are set to read-only mode in production
- Infrastructure that is created by hand and never by code
Answer
Never patching servers in place; build a new image/instance for every change and replace the old one
Why
In the old approach, servers were logged into and updated by hand over the years. Each one ended up slightly different ('configuration drift') and hard to recreate.
With immutable infrastructure, you never modify a running server: you build a new image (container or VM image) in CI and replace the old servers with new ones.
Rolling back is just running the previous image.
Remember
Don't patch servers; replace them with a new image.