Blue Green Deployment
Blue Green Deployment
BLUE/GREEN
DEPLOYMENT
USERS
1. Amazon ECS:
In Amazon ECS, you can easily set up two identical task
groups: one representing the Blue environment and the
other the Green. After deploying a new version in the
Green environment, traffic can be switched using a load
balancer.
In this case, we use the same load balancer but with two
listener rules that listen on different ports: 8080 for Blue
and 80 for Green.
The deployment completes by switching listener rules
between the two target groups, ensuring a quick and safe
transition to the new version. If issues arise, it's easy to
revert back to the previous version by reassigning traffic.
2. AWS Elastic Beanstalk:
Elastic Beanstalk has built-in Blue/Green Deployment
support. You can deploy a new version of your
application in the Green environment, test it, and then
switch traffic using the "Swap environment URLs"
feature.
This simply swaps the CNAME records of the old and
new environments, effectively redirecting traffic from the
old version to the new one. This approach is similar to
the account migration example I shared earlier.
3. AWS Lambda with Application Load Balancer and
Weighted Target Groups:
In this scenario, you create two versions of a Lambda
function: Blue and Green. Each function version is tied to
a separate target group in an Application Load Balancer
(ALB).
You can gradually shift traffic from the Blue version to
the Green by adjusting the weighted values of the target
groups. Alternatively, you can instantly switch all traffic
by setting one version's weight to 0% and the other's to
100%.
Canary Deployment:
Process: A small percentage of traffic is gradually routed
to the new version (canary), while the rest continues
using the old version. If no issues are detected, the
canary version progressively receives more traffic until
100% is switched over.
Benefits: Allows for gradual testing of the new version
with live users. Reduces the risk of wide-scale failures by
exposing only a portion of users to the new version
initially.
Drawbacks: Slower to fully deploy, as it requires
monitoring at each stage. Rollback is more complex than
Blue/Green if issues are detected late in the process.
Rolling Deployment:
Process: The new version is deployed incrementally
across the infrastructure, replacing old instances one at
a time. During the process, both the old and new
versions may be live at the same time.
Benefits: No need for duplicate environments, so it’s
cost-effective. Suitable for large-scale applications
where deployments can be handled in smaller batches.
Drawbacks: Can introduce inconsistency, as different
users might see different versions during the
deployment. Rollback can be slow and complicated if
issues arise after partial deployment.
A/B Testing Deployment:
Process: Similar to Blue/Green, but with a focus on
testing different features or versions (A and B) for
comparison. Users are split between the two
environments to evaluate performance, user experience,
or new features.
Benefits: Provides insights into user behavior and
performance differences between versions. Allows for
data-driven decisions based on real-time feedback.
Drawbacks: May require long-running parallel
environments, increasing costs. Not ideal for critical
application updates where one version must fully replace
the other.
Highlander Deployment:
Process: The new version of the application is deployed
across all servers simultaneously. The old version is
entirely removed, and only the new one remains active.
Benefits: There is no need for duplicate infrastructure,
as only one environment is maintained. With no need to
maintain two separate environments (Blue and Green),
infrastructure costs are lower.
Drawbacks: If the new version has issues, all users will
experience problems simultaneously, with no quick
rollback option. There is no opportunity to test the new
version in a live environment before deployment.
2. Monitoring
and Testing
1. Planning
and Preparation
4. Documentation
and Training
3. Automation:
Implement automated deployment and traffic switching
processes to minimize human error and speed up the
migration process. This will enhance the reliability and
efficiency of your deployment.
4. Documentation and Training:
Train your team on Blue/Green Deployment techniques
and prepare detailed documentation to streamline the
deployment and rollback processes. Clear guidelines will
make the process smoother and ensure everyone is
aligned.
Thank you for your time!
https://www.linkedin.com/in/alputov/
Anton Alputov is a mature IT professional
offering 14 years of hands-on experience in
the Web industry. Strong knowledge of Java
8-17. Deep knowledge and versatile
experience in DevOps, building interactive
Web applications onRESTful
Spring framework (Core, MVC, Data, Security)
and Spring Boot.
I can write SQL queries and have excellent experience in database
normalization and optimization. I love writing unit and integration
tests. I guarantee clean code,
adherence to SOLID and OOP design
patterns. On the last project, I
actively worked with microservice
architecture on Spring Cloud.