- Immutable deployment: instead of renovating a house while living in it, you build a brand-new house with all the updates. Once it’s ready you move in and dispose of the old house. There is no dust, no mid-renovation downtime, and no risk of leaving the old house in a partially modified state.
- Mutable deployment: you stay in the same house and make changes while people are living there — repaint walls, change lighting, replace furniture — and every change is visible immediately. If something breaks during the update, users see it live.

- Pros: Smaller incremental updates, lower short-term resource use, and often faster for tiny fixes on VMs.
- Cons: Prone to configuration drift, inconsistencies across hosts, riskier rollbacks (manual steps may be required), and accumulation of undocumented changes.
- SSH, AWS Systems Manager (SSM)
- Configuration management: Chef, Puppet, Ansible
- In-place OS/app patching and live edits
Mutable updates can be useful for quick hotfixes or emergency patches, but they require strong configuration management and drift detection to remain reliable at scale.


- Instant rollback by switching traffic back to the previous environment.
- Minimal user disruption during deployment.
- Safer testing with real production traffic because you can quickly cut over or revert.


-
Mutable deployments
- Pros: Smaller incremental updates, lower immediate resource use, and quick for small live changes.
- Cons: Configuration drift, difficult rollbacks, and increased operational complexity over time.
-
Immutable deployments
- Pros: Reproducible, versioned environments; easy and reliable rollbacks; reduced risk from undocumented changes; simpler debugging of known-good images.
- Cons: Often requires temporary parallel environments (higher resource usage during deployment) and additional tooling for image/version builds and orchestration.
Immutable deployments are safer, but they can increase short-term resource costs because you run parallel environments during cutover. Factor this into capacity planning and CI/CD pipeline design.
Recommended AWS services and patterns
- AMI-based: EC2 Image Builder, AMIs, Auto Scaling groups
- Containers: Amazon ECS, Amazon EKS with image-tag/version strategies
- Serverless: AWS Lambda versions and aliases + CodeDeploy traffic shifting
- Traffic control: Route 53 weighted routing, Application Load Balancer
- CI/CD orchestration: AWS CodePipeline, CodeDeploy, CloudFormation, Terraform
- AWS Lambda course — Versions and traffic shifting
- Amazon EC2 Image Builder and AMIs
- AWS CodePipeline and CodeDeploy for CI/CD
- Ansible basics — Configuration management
