Project Report 43
Project Report 43
This project focuses on implementing Blue-Green Deployment strategies for web applications
using AWS cloud services and DevOps tools like Jenkins, Docker, and Terraform. Traditionally,
application deployments may cause downtime and user disruption. The proposed system
identical environments (Blue and Green) and automating traffic switching through load balancers
It supports both manual and automated deployments, giving organizations the flexibility to
Time-consuming
Error-prone
Additionally, the growing complexity of cloud-native applications demands faster, more reliable,
and automated deployment strategies. This project addresses the problem by using a Blue-Green
Deployment approach combined with AWS and DevOps tools to achieve seamless, risk-free
releases.
A system where two identical environments (Blue and Green) are maintained
1
A CI/CD pipeline using Jenkins that automates building, testing, and deploying the application to
Automated or manual traffic switching using AWS services like Route53 and Elastic Load
Balancer
Security-focused design ensuring minimal disruption during deployments and protecting user
data integrity
Automate the build, test, and deploy process using Jenkins and AWS services
Reduce the risk and time associated with traditional deployment methods
Offer flexibility through support for both manual and automated traffic switching
Allow scalability and adaptability across different cloud environments and use cases
Included:
Excluded:
2
1.2 Software and Hardware Requirements
AWS Services: EC2, Elastic Load Balancer (ALB), Route53, S3, Auto Scaling Groups
Cloud Requirements:
Functional Requirements
Traffic Routing: Switch traffic between environments using Load Balancer or DNS
3
Rollback Mechanism: Ability to revert back to Blue if Green deployment fails
Monitoring and Alerts: Setup basic CloudWatch alarms for health checks
Non-Functional Requirements
Performance: Deployment should switch environments with less than 5 seconds of downtime
Usability: Pipeline and deployment process must be intuitive and easy to operate
Maintainability: Code, pipeline scripts, and infrastructure should be modular for easy updates and
scaling
4
CHAPTER 2: LITERATURE SURVEY
Recent advances in Cloud Computing, CI/CD pipelines, and Infrastructure Automation have led to the
adoption of techniques like Blue-Green Deployment. In Blue-Green Deployment, two identical production
environments (blue and green) are maintained to reduce downtime and risk during application updates.
Research by Amazon Web Services (AWS) and continuous delivery experts highlights that this method
minimizes service disruption and rollback complexities.
In the DevOps domain, tools like AWS Elastic Beanstalk, AWS CodeDeploy, Jenkins, and Spinnaker have
emerged to implement Blue-Green strategies, but they still require careful manual configuration. The lack
of standardized, fully automated solutions across diverse tech stacks presents challenges.
Key studies such as:
● "Continuous Delivery and Deployment Best Practices" (Google Cloud Research, 2021), and
● However, is more suited to basic apps, needs customization for advanced workloads.
5
Kubernetes Blue-Green Deployment:
● Jenkins, GitLab CI, and CircleCI allow Blue-Green style releases via scripting.
● Most studies focus on either public cloud or Kubernetes, but not hybrid/multi-cloud environments
together.
Despite considerable advancement in deployment automation, specific gaps still exist in applying Blue-
Green Deployments consistently across environments. The major gaps identified are:
Identified Gaps:
Automation Most solutions need manual steps to shift traffic between environments.
Accessibility Complex setup; non-experts struggle with VPCs, load balancers, and
route swapping.
Integration of DevOps No streamlined connection between popular DevOps tools and Blue-
Tools Green patterns.
6
Deployment Flexibility Limited hybrid cloud or multi-cloud Blue-Green deployment support.
Monitoring & Validation Weak integration for automatic health checks and rollback triggers.
This project leverages AWS services and DevOps tools to deliver a reliable Blue-Green deployment
framework. Technologies used include:
● AWS Elastic Beanstalk / EC2 / ECS: Hosts the application across Blue and Green environments.
● AWS CodePipeline and CodeDeploy: Automate deployment, traffic shifting, and rollback.
● AWS Application Load Balancer (ALB): Routes live traffic between Blue and Green stacks.
DevOps Tools:
● Kubernetes (Optional): If using EKS clusters for container orchestration during Blue-Green.
7
● AWS CloudWatch and AWS X-Ray: Monitor application health, error rates, and trigger alarms.
● Manual/Automated Validation Scripts: Ensure successful deployment before full traffic cutover.
Comparing traditional deployment, rolling updates, and Blue-Green strategies highlights the advantages of
this project's approach:
Automation Low – Manual scripts Medium – Pipelines with High – Full pipeline-based
scripts automation
8
Although traditional and rolling updates are simpler for small apps, Blue-Green Deployment excels for
mission-critical systems requiring high availability and instant rollback.
This project fills the missing gap by combining AWS's managed services and DevOps automation tools to
create a reusable, flexible, and production-grade Blue-Green deployment pipeline.
Deployment Practices:
● Rolling Updates: Gradually replace instances, which can impact users during transition.
● Manual Server Switch: Moving traffic manually between old and new environments.
● Hard Rollbacks: Reverting to a stable version after a failed deployment can be complex.
Lack of Testing New versions might not be fully tested in a real-world environment
before deployment.
10
3.2 Proposed System
The proposed system aims to implement Blue-Green Deployment using AWS services and
DevOps automation tools.
It enables seamless deployments with near-zero downtime by maintaining two separate
production environments (Blue and Green).
Deployment Workflow:
4. After Green passes health checks, the Load Balancer switches traffic to Green.
11
5. If issues are found, easy rollback to Blue.
Feature Description
DNS Switching Use Route53 or ELB Listener Rules for traffic management.
Advanced Features:
Feature Description
Traffic Splitting (Optional) Canary-style partial traffic routing before full switch.
Security Features:
12
● Encrypted environment variables and secrets management (e.g., AWS Secrets Manager).
Resource Requirements:
13
Skills Availability:
Conclusion:
Technically highly feasible with widely available AWS and DevOps toolsets.
Long-Term Savings:
Conclusion:
Economically feasible for small, medium, and enterprise applications.
14
User Acceptance:
Integration:
Training Requirements:
This section outlines the overall design of the proposed Blue-Green Deployment system for web
applications using AWS and DevOps tools from a high-level perspective. The architecture is
composed of several key components working together to automate, manage, and streamline zero-
downtime deployments:
15
1. User Interface (UI)
2. Backend Server
● Built using a lightweight web framework (e.g., Flask, FastAPI, or Node.js Express).
● Responsibilities include:
● Functions:
16
○ Automates deployment to either Blue or Green environment on AWS (using EC2,
ECS, or EKS).
● Responsibilities:
○ Switches user traffic from Blue to Green environment upon successful validation.
● Manages:
○ Storage of build artifacts (Docker images, WAR files, etc.) in AWS S3 or AWS
ECR.
17
● Critical for ensuring secure and stable deployment operations.
● Handles:
○ IAM roles and policies for limited, secure access to AWS services.
Key Benefits:
18
● Instant Rollback: If errors are detected, traffic can quickly be re-routed back to the Blue
environment.
● Automated and Reliable: Full CI/CD integration for faster and more dependable releases.
● Security Focused: Secure access, encrypted secrets, and real-time monitoring ensure
operational integrity.
19
4.2 Detailed Design (Low-Level Design)
4.2.1 Data Flow Diagram (DFD)
●
User Inputs Backend Validates Input Deployment Strategy Chosen (Blue or Green) Traffic Manage
20
4.2.2 Use Case Diagram
21
4.2.4 Class Diagram
If object-oriented design is used:
Classes:
When applying object-oriented design to a system that generates Dockerfiles and Kubernetes
YAMLs using LLMs, we break the system into logical components, each represented by a class.
22
23
CHAPTER 5: IMPLEMENTATION & CODING
This chapter provides an overview of the system architecture and design approach for
implementing Blue-Green Deployment strategies for web applications. The system leverages
AWS cloud services, Jenkins, Docker, and Terraform to ensure zero-downtime deployments,
ensuring high availability and reliability while minimizing user disruption.
For the implementation of this Blue-Green Deployment system, the following programming
languages, libraries, and frameworks were utilized:
Programming Language
● Python
○ Python is used for its simplicity, extensive libraries, and compatibility with AWS
SDKs (boto3) and Terraform automation.
DevOps Tools
● Jenkins
○ Jenkins is used for CI/CD pipelines, automating the build, test, and deployment
processes.
○ It integrates with AWS and Docker to automate Blue-Green Deployment steps and
monitor the process.
● Docker
24
○ Docker is used for containerization, ensuring that applications run consistently
across different environments (Blue and Green).
○ Docker images are built and stored in Amazon Elastic Container Registry (ECR)
and deployed using AWS services like ECS or EKS.
● Terraform
○ It simplifies resource management, tracking, and scaling for both Blue and Green
environments.
○ Amazon Elastic Load Balancer (ELB): Used to switch traffic between Blue and
Green environments seamlessly without downtime.
○ Amazon Route 53: For DNS management to redirect traffic between Blue and
Green environments.
○ Amazon ECS (Elastic Container Service): For deploying Docker containers into
AWS, used for running the Blue and Green environments.
The Blue-Green Deployment system is designed to ensure zero downtime by managing two
identical environments (Blue and Green). The system uses a series of automated and manual steps
25
to switch traffic between the environments, ensuring that users are always routed to a stable and
live version of the application.
Flowchart Overview
Start
26
Switch traffic from Blue to Green (via ELB or Route 53)
End
Detailed Steps
● Jenkins Pipeline: The process starts with Jenkins pulling the latest application code from
the repository and building a Docker image.
● The Docker image is then pushed to Amazon Elastic Container Registry (ECR) for
storage and later deployment.
● Terraform is used to provision the necessary AWS resources for the Blue and Green
environments, including:
○ Elastic Load Balancer (ELB): Configured to route traffic between the two
environments.
○ Amazon ECS: Each environment (Blue and Green) is deployed as a separate ECS
cluster or service, running identical application containers.
27
○ Auto Scaling Groups (ASGs): Automatically scale ECS tasks based on load.
○ Amazon Route 53: Manages DNS for seamless routing between Blue and Green
environments.
● Initially, traffic is routed to the Blue environment, which is the live production
environment.
● The new version of the application is deployed to the Green environment. This version is
identical to the Blue environment, except for the new updates.
● Automated Testing (Optional): Jenkins can trigger automated tests to validate that the new
version in the Green environment is working as expected. If tests pass, the deployment
continues.
5. Traffic Switching
● Elastic Load Balancer (ELB) or Amazon Route 53 is used to reroute traffic from the Blue
environment to the Green environment.
○ ELB: Automatically switches traffic between Blue and Green without downtime.
○ Route 53: If using DNS-based switching, Route 53 updates the DNS records to
point to the Green environment’s IP address.
28
● Manual or Automated Monitoring: After traffic is switched to Green, the system monitors
performance metrics (such as response times and error rates) to ensure the new
environment is stable.
7. Clean Up
● Once the Green environment has been verified as stable, the Blue environment is
decommissioned. If there are any issues, the traffic can be switched back to Blue, allowing
time for debugging and fixing issues.
Key Highlights:
● Zero Downtime: The core objective of Blue-Green Deployment is to ensure that there is
no downtime during application updates, and traffic is routed seamlessly between
environments.
● Automated and Manual Control: The system provides flexibility by supporting both
automated and manual deployment and testing processes.
● Scalable Infrastructure: Using AWS and Terraform ensures that infrastructure can scale
automatically, depending on the application’s needs.
● DevOps Best Practices: The system follows best practices in DevOps by automating
CI/CD pipelines with Jenkins, using infrastructure as code (Terraform), and
containerization with Docker.
SNIPPET - 1
provider "aws" {
region = "us-east-1"
access_key = "YOUR_ACCESS_KEY"
secret_key = "YOUR_SECRET_KEY"
29
}
ami = "ami-0c55b159cbfafe1f0"
instance_type = "t2.micro"
tags = {
Name = "Swiggy-Kastro-Server"
#!/bin/bash
terraform init
terraform plan
30
5.3.1 Key Functionalities for Blue-Green Deployment (Web Applications)
2. Validation Module:
○ Ensures all necessary fields are completed, specifically for determining if the user
is deploying to the Blue or Green environment.
○ Verifies configurations such as load balancer settings, traffic rules, and DNS
settings.
○ Based on user input, the system prepares traffic routing logic to switch between
Blue and Green environments:
○ Defines the rules for routing user traffic to the active environment and preparing
the switch once the update is verified.
31
4. Deployment Configuration:
○ The system prepares deployment configurations for the web application, whether
it’s setting up environments using load balancers, DNS records, or other traffic
routing methods.
○ Ensures that during the deployment, only one environment (either Blue or Green)
receives live traffic, and the other is idle for updates.
32
Software testing ensures the reliability, performance, and functionality of the developed Blue-
Green Deployment system. Multiple levels of testing are performed to verify the correct
operation of individual components and their interactions in the deployment process.
Objective:
To test individual modules and functions to ensure each one performs as expected in isolation.
Tested Components:
● Traffic switching logic for load balancer setup (Blue and Green environments)
● AWS infrastructure provisioning scripts (Terraform module for Blue and Green
environments)
Tools Used:
● Mocking frameworks for simulating AWS resources and Jenkins pipeline execution (e.g.,
unittest.mock)
33
Objective:
To ensure that the modules work correctly when combined, and data flows properly between
them, ensuring that deployments are seamlessly automated.
Tested Integrations:
● Backend communication with AWS services (e.g., Elastic Load Balancer, EC2 instances,
Route 53 for traffic switching)
● Jenkins CI/CD pipeline integration for triggering the deployment from code push to
production
● Script output to UI for final user view, including successful deployment status and traffic
switch confirmation
Scenarios Covered:
● Valid deployment inputs trigger the correct traffic switch from Blue to Green environment
● Dockerfile and Kubernetes YAML files are generated and deployed correctly based on AI-
assisted suggestions
● User interface displays deployment status, error logs (if any), and confirmation messages
without delay
● Verification that AWS services interact as expected during Blue-Green traffic switching
and backend processing
34
Tools Used:
● Postman for API endpoint testing (to test traffic switching between environments)
● Docker and Kubernetes testing environments for integration with AWS services
Objective:
To verify the complete end-to-end functionality of the Blue-Green deployment system in both
local and cloud environments.
Environment Setup:
● Local setup: Simulate Blue-Green environments using Docker containers and Minikube
for testing the traffic switching
● Cloud-based integration: Use AWS resources (Elastic Load Balancer, EC2, Route 53) for
actual Blue-Green environment deployments
● Sample user inputs for application deployments in various languages and configurations
Test Goals:
● Ensure the Blue-Green deployment system runs as expected under normal conditions, with
minimal downtime during environment switches
● Verify the integration between frontend UI, backend logic, AI model for script generation,
and AWS infrastructure deployment works seamlessly
● Ensure the system performs well under both normal load and edge cases (boundary
conditions like large-scale traffic redirection)
35
● Validate UI/UX, including accurate deployment progress updates, error handling, and
performance (response time and traffic switch speed)
● Check that traffic is directed properly from Blue to Green and back, based on both manual
and automated processes
● Confirm that AWS services such as EC2, ELB, and Route 53 manage the traffic flow
effectively during deployments
Tools Used:
36
The Blue-Green Deployment system was thoroughly tested to ensure reliability, seamless
performance, and smooth user experience during deployments. Testing was carried out at multiple
levels — unit, integration, and system testing — covering both individual components and the
complete deployment workflow.
37
This chapter presents the experimental environment, performance observations, and comparative
analysis for the deployment of a web application using the Blue-Green Deployment strategy. The
goal is to demonstrate the system’s reliability, performance improvements, and smooth user
experience achieved through controlled deployments.
To ensure a comprehensive evaluation, the Blue-Green Deployment process was tested in both
local and cloud environments. The setup aimed to simulate real-world deployment conditions for
web applications.
38
Browsers Tested Google Chrome, Mozilla Firefox
Applications were containerized using Docker and deployed using Kubernetes clusters. AWS
Elastic Load Balancer and Route 53 were used to manage traffic between Blue and Green
environments.
● Blue-Green Setup: Two identical environments (Blue and Green) were configured.
● Traffic Switching: Elastic Load Balancer (ELB) was used to shift user traffic between
environments after deployment validation.
● Rollback Plan: In case of failure, traffic could immediately revert to the stable
environment.
This strategy minimized downtime, ensured continuous availability, and allowed rapid recovery
from deployment issues.
39
● Rollback handling in case of failures
Observations
Aspect Performance
Load Handling Handled normal and peak loads efficiently across environments
The Blue-Green approach demonstrated a clear advantage by allowing the new version of the
application to be tested in the Green environment before live traffic was redirected, significantly
reducing deployment risks.
40
Criteria Traditional Deployment Blue-Green Deployment
Deployment Risk High (direct impact on users) Low (testing before switching)
Conclusion of Results
The experimental evaluation confirms that Blue-Green Deployment is highly effective for web
application deployment, ensuring minimal downtime, seamless user experience, and quick
recovery in case of failures. By maintaining two identical environments and controlling traffic
flow smartly, deployment risks were significantly reduced compared to traditional methods. The
strategy offers a modern, reliable approach for continuous delivery and operational stability in
web applications.
41
fig 1.1 : Creating and initialising infrastructure with Terraform
42
fig 1.3 : Installing plugins from jenkins
43
fig 1.5 : Build logs for above image
44
CHAPTER 8: CONCLUSION AND FUTURE
ENHANCEMENTS
8.1 Conclusion
This project, "Web Application Deployment Using Blue-Green Strategy," was designed and
implemented to ensure high-availability, minimal downtime, and reliable rollout of application
updates in a production environment. By maintaining two identical environments — Blue (current
production) and Green (new version) — the project allowed safe deployment of updates with an
immediate rollback mechanism in case of failures.
Through Blue-Green Deployment, user experience was preserved even during critical updates,
operational risks were significantly reduced, and deployment processes became more predictable
and controllable. This method also enabled seamless scaling and faster recovery from potential
production issues.
Despite achieving its core objectives, the project has a few limitations:
● Infrastructure Cost: Maintaining two separate environments (Blue and Green) can
increase operational costs, especially for large-scale applications.
● Traffic Management Complexity: Properly managing DNS and load balancers requires
careful planning and might lead to temporary routing issues if not configured correctly.
45
● Rollback Coverage: While code rollbacks are immediate, database schema changes or
persistent storage updates may still require additional manual handling.
● Limited Dynamic Scaling: The project currently handles fixed environments; integration
with auto-scaling policies for Blue-Green environments can be further improved.
Several future enhancements are possible to further strengthen the Blue-Green Deployment
process:
● Automated Health Checks: Integrate health check scripts to automatically verify the new
environment before switching traffic.
● Real-Time Traffic Analysis: Use analytics to monitor live user interactions and automate
rollback if anomalies are detected post-switch.
● ChatOps Integration: Integrate deployment controls into messaging platforms (like Slack
or MS Teams) for easier deployment and monitoring via commands.
46
● Pipeline Integration: Deepen CI/CD integration with platforms like Jenkins, GitHub
Actions, or GitLab CI for fully automated end-to-end deployments.
REFERENCES
4. M. Villamizar et al., "Cost Comparison of Web Applications in the Cloud: A Total Cost of
Ownership Model," IEEE CLOUD, 2015.
5. N. Woolf, Release It!: Design and Deploy Production-Ready Software, 2nd ed., Pragmatic
Bookshelf, 2018.
47
5. DevOps.com – Best Practices for Blue-Green Deployments. [Online]. Available:
https://devops.com/blue-green-deployment-best-practices
● AWS EC2, Elastic Load Balancer, and Route 53 for cloud environment setup
48