Zero-Downtime CI/CD for 100K+ Daily Requests with Blue-Green Deployments
These articles are AI-generated summaries. Please check the original sources for full details.
Building a Zero-Downtime CI/CD Pipeline: Blue-Green Deployments for 100K+ Daily Requests
This article details how a GitHub Actions + Docker + Blue-Green deployment strategy achieved zero downtime for a push notification service handling 100,000+ daily requests. The implementation avoids partial outages, ensures in-flight request completion, and enables instant rollbacks.
Why This Matters
Traditional deployment strategies like rolling updates or canary releases introduce partial downtime or infrastructure complexity. For services with long-running processes (e.g., BullMQ workers) or strict uptime requirements, Blue-Green deployments eliminate these risks. This approach guarantees zero downtime by maintaining two identical environments and switching traffic via Nginx in under 10ms. The cost of downtime for high-traffic systems can be catastrophic, making this method essential for production-grade reliability.
Key Insights
- “150+ deployments with 0 user-reported issues (6 months of production use)”
- “Multi-stage Dockerfiles reduce image size by 3.4x, improving security and build speed”
- “GitHub Actions used for CI/CD, enabling zero-maintenance pipelines with native GitHub integration”
Working Example
# Dockerfile: Multi-Stage Build
# ============= Stage 1: Build =============
FROM node:22-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
# ============= Stage 2: Runtime =============
FROM node:22-alpine AS runner
WORKDIR /app
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/package*.json ./
RUN apk add --no-cache curl && npm install --only=production
EXPOSE 3002
CMD ["node", "dist/main"]
# docker-compose.yml: Health Checks for Blue-Green
services:
messaging-blue:
build: .
env_file: .env
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3002/health/live"]
interval: 10s
timeout: 5s
retries: 5
start_period: 20s
# deploy-messaging.sh: Blue-Green Switch Logic
# ...
sudo sed -i "s/server localhost:3011;/server localhost:3012;/" /etc/nginx/conf.d/messaging.goodtv.co.kr.conf
sudo nginx -s reload
# ...
Practical Applications
- Use Case: High-traffic push notification service with 100K+ daily requests using Blue-Green deployments
- Pitfall: Overlooking health checks can lead to premature container switches and 502 errors during deployment
References:
Continue reading
Next article
BURN RATE ALERT: Safety Buffer Servers Are Costly Waste
Related Content
Streamlining Docker Swarm and Compose Deployments via GitHub Actions
Deploy Docker Compose and Swarm services to remote hosts using the docker-remote-deployment-action with zero custom CI scripts.
Provisioning AWS Networking with Terraform: A Hands-on Infrastructure as Code Guide
Learn to build a production-ready AWS VPC using Terraform to automate networking with public and private subnets, supporting up to 65,536 addresses.
Deploying Scalable Flask Applications on AWS with GitHub CI/CD Pipelines
Architecting a Flask movie quiz app using EC2, RDS, and Nginx with an automated GitHub Actions ECR deployment pipeline for high availability.