domain platform Commons: 3/5

Rolling Deployment Pattern

Also known as: Gradual Deployment, Incremental Deployment

1. Overview

The Rolling Deployment pattern is a software release strategy that updates an application by incrementally replacing old instances with new ones. Instead of a simultaneous, “big bang” update across all servers, this method introduces the new version to a subset of servers at a time. This gradual process continues until all instances are running the new version. The primary goal of a rolling deployment is to achieve zero-downtime releases, minimizing the impact on end-users and providing a window to detect and address issues before they affect the entire user base. This pattern has become a cornerstone of modern DevOps practices, enabling continuous delivery and frequent, reliable updates.

2. Core Principles

The Rolling Deployment pattern is defined by a set of core principles that ensure a smooth and safe release process:

Principle Description
Incremental Rollout The new version is deployed to a small number of instances at a time, in a phased manner.
Zero-Downtime The application remains available to users throughout the deployment process, as there are always healthy instances running.
Automated Rollback If the new version introduces errors or performance degradation, the deployment process can be automatically reversed to the previous stable version.
Health Checks Continuous monitoring and health checks are performed on the new instances to ensure they are functioning correctly before proceeding with the rollout.
Load Balancing A load balancer is used to distribute traffic between the old and new instances, gradually shifting traffic to the new version as the rollout progresses.

3. Key Practices

Traditional deployment methods often require taking the application offline for a period of time to perform the update. This scheduled downtime can lead to a poor user experience, loss of revenue, and a negative impact on the business. Furthermore, if the new version contains critical bugs, rolling back to the previous version can be a complex and time-consuming process, extending the outage. The challenge is to deploy new application versions frequently and reliably without interrupting service availability or introducing significant risk.

4. Implementation

The Rolling Deployment pattern addresses this problem by providing a mechanism for gradual, controlled updates. The process begins by taking a small number of instances out of the load balancer’s rotation, deploying the new version to them, and then adding them back into the rotation. This process is repeated until all instances are running the new version. Health checks are performed at each stage to ensure the stability of the new instances. If an issue is detected, the rollout is halted, and the affected instances are rolled back to the previous version. This approach significantly reduces the risk of a failed deployment and ensures that the application remains available to users throughout the update process.

5. 7 Pillars Assessment

Pillar Score (1-5) Rationale
Purpose 3 Serves a clear technical purpose in system design
Governance 3 Can be governed through standard engineering practices
Culture 3 Supports engineering culture of reliability and quality
Incentives 3 Aligns incentives toward system stability
Knowledge 4 Well-documented pattern with extensive community knowledge
Technology 4 Directly applicable to modern technology stacks
Resilience 4 Contributes to overall system resilience
Overall 3.4 A valuable technical pattern that supports commons infrastructure

While the Rolling Deployment pattern offers significant advantages, it also has some trade-offs that need to be considered:

Pros Cons    
Zero-Downtime Deployments The application remains available during the update process. Slower Rollouts The gradual nature of the deployment can be slower than other methods.
Reduced Risk Issues can be detected and addressed before they impact all users. Temporary Inconsistencies For a period of time, both the old and new versions of the application are running simultaneously, which can lead to compatibility issues.
Simplified Rollbacks Rolling back to the previous version is a straightforward process. Infrastructure Overhead Requires a more complex infrastructure with load balancing and health checking capabilities.

6. When to Use

The Rolling Deployment pattern is widely used in modern software development and is supported by many popular platforms and tools:

  • Kubernetes: Kubernetes uses a rolling update strategy by default for its Deployments, allowing for zero-downtime updates of applications.
  • Amazon Web Services (AWS): AWS Elastic Beanstalk and AWS CodeDeploy both provide built-in support for rolling deployments, enabling automated and controlled updates of applications running on EC2 instances.
  • Microsoft Azure: Azure App Service and Azure Kubernetes Service (AKS) offer rolling deployment capabilities, allowing developers to deploy new versions of their applications with minimal disruption.

7. Anti-Patterns & Gotchas

In the cognitive era, AI and machine learning can be leveraged to enhance the Rolling Deployment pattern. For example, predictive analytics can be used to analyze telemetry data from the new instances and identify potential issues before they impact users. Anomaly detection algorithms can monitor application performance and automatically trigger a rollback if any unexpected behavior is detected. This proactive approach to monitoring and rollback can further reduce the risk of failed deployments and improve the overall reliability of the application.

8. References

The Rolling Deployment pattern aligns with several of the Commons principles:

  • Shared Resource: The pattern promotes the efficient use of infrastructure resources by allowing for continuous updates without requiring a separate, dedicated environment for testing.
  • Democratic Governance: The use of automated health checks and rollbacks empowers development teams to make data-driven decisions about the deployment process.
  • Equitable Access: By ensuring zero-downtime deployments, the pattern provides all users with continuous and uninterrupted access to the application.
  • Sustainability: The pattern supports the long-term sustainability of the application by enabling frequent, low-risk updates that can adapt to changing user needs and technological advancements.
  • Community Benefit: The pattern benefits the entire community of users by providing a more stable and reliable application experience.

8. References

[1] Rolling deployments - Overview of Deployment Options on AWS [2] Blue-Green vs. Rolling Deployments: Pros, Cons & Best Practices [3] Rolling Deployments: Pros, Cons, And 4 Critical Best Practices [4] What is Rolling Deployment and How Does it De-Risk Releases?