Immutable architecture
Immutable architecture is more reliable, consistent and predictable.
Immutable means something that is not capable of change
Immutable architecture characteristics
- Do not try to update, upgrade or apply security patches on Server hardware, OS or security software. Rather just create a new server and deploy application on it.
- Stop any SSH or manual access to servers
- Send same code to all the environments
VS
- Do not download any dependency on run time, rather keep them offline in artifactory
- Also, if we use Canary/Blue-Green deployment possibility of downtime is almost gone
- Rollback should be setup
- This will stop any malicious attack because server is completely out of external interference
Canary Deployment
Routing strategy for Canary
Achieve Canary in AWS by
- Route 53: Route through Route 53
Minimize TTL value for faster Route 53 updation
- Rolling deployments for auto scaling groups
a. 2 auto scaling group has to be there
b. 1st auto scaling group is the production environment
c. Keep removing no of servers from the 1st
d. And keep increasing no of servers from the 2nd
e. The more instances slower updation
- Application load balancer and weighted target groups
a. Create target groups for load balancer and route traffic to it
b. Session stickiness can be enabled so session is not lost
- API Gateway
a. Only for REST API
b. We can set percentage of the API requests to a new API deployment for a particular stage
c. Use cloud watch metric to monitor the performance and errors of the API and react to them
d. We can also gradually increase the percentage of requests handled by the new API deployment and rollback if errors are detected
- Lambda alias traffic shifting
a. Just update the version weighs of a particular lambda alias and traffic will be routed to a new version of that function
b. Use cloud watch metric to monitor the performance and errors of the API and react to them
Automate using code deploy with canary deployment
Top comments (0)