Simplifying web deploys

Pinterest Engineering
10 min readintermediate
--
View Original

Overview

The article discusses Pinterest's transition from a Blue-Green deployment model to a Rolling deployment model for their web application. This shift was driven by the need for improved agility, reduced complexity, and better handling of production metrics.

What You'll Learn

1

How to implement a Rolling deployment model for web applications

2

Why transitioning from Blue-Green to Rolling deployments can enhance agility

3

When to use version affinity between client-side and server-side applications

Key Questions Answered

What are the advantages of Rolling deployments over Blue-Green deployments?
Rolling deployments allow for a more gradual transition between versions, reducing the risk of regressions that can occur when switching from one version to another instantly. This approach also simplifies the routing logic and minimizes the need for maintaining two active instances, which can complicate resource management.
How does Pinterest handle version affinity in their web application?
Pinterest ensures version affinity by requiring that XHR requests from a client running a specific version are processed by server-side code from the same version. This mechanism helps maintain consistency and reduces issues during deployments.
What challenges did Pinterest face with their old Blue-Green deployment model?
The Blue-Green deployment model required maintaining two instances of the web application, leading to increased resource usage and complexity. Additionally, it lacked a gradual ramp-up process for new versions, which sometimes resulted in undetected regressions appearing in production.
What role does Envoy play in Pinterest's new deployment strategy?
Envoy serves as the ingress proxy that manages traffic routing during deployments. It allows for custom filters to handle the routing logic, enabling a smooth transition to Rolling deployments while maintaining version affinity between client and server.

Technologies & Tools

Some links below are affiliate links. We may earn a commission if you make a purchase.

Key Actionable Insights

1
Transitioning to a Rolling deployment model can significantly reduce the risk of regressions during updates.
By allowing multiple versions to coexist during a deployment, teams can detect issues earlier and roll back more easily, which enhances overall system reliability.
2
Implementing version affinity is crucial for maintaining application consistency during deployments.
Ensuring that clients interact with the correct server-side version minimizes errors and improves user experience, especially during transitions.
3
Utilizing Envoy for traffic routing can simplify deployment processes and enhance flexibility.
Envoy's extensibility allows teams to customize routing logic, which is essential for managing complex deployment scenarios effectively.

Common Pitfalls

1
Maintaining two active instances can lead to resource inefficiencies and increased complexity.
This setup requires careful management of resources and can complicate the deployment process, making it harder to scale effectively.
2
Failing to implement a gradual ramp-up process can result in undetected regressions.
Without a gradual transition, issues may only surface after a full deployment, leading to potential downtime and user impact.