Back to Developer Roadmap

Zero Downtime

src/data/question-groups/devops/content/zero-downtime.md

4.01.2 KB
Original Source

Zero-downtime deployments are crucial to maintain the stability of service with high-traffic applications. To achieve this, there are many different strategies, some of which we’ve already covered in this article.

  1. Blue-Green Deployment: Set up two identical environments—blue (current live) and green (new version). Deploy the new version to the green environment, test it, and then switch traffic from blue to green. This ensures that users experience no downtime.
  2. Canary Releases: Gradually route a small percentage of traffic to the new version while the rest continues to use the current version. Monitor the new version's performance, and if successful, progressively increase the traffic to the new version.
  3. Rolling Deployments: Update a subset of instances or Pods at a time, gradually rolling out the new version across all servers or containers. This method ensures that some instances remain available to serve traffic while others are being updated.
  4. Feature Flags: Deploy the new version with features toggled off. Gradually enable features for users without redeploying the code. This allows you to test new features in production and quickly disable them if issues arise.