Skip to content

Shadow Deployment

Shadow Deployment is a release strategy where a new version of an application is deployed alongside the existing version.^[400-devops__06-Kubernetes__k8s-ithelp__Day12__README.md] Unlike other strategies that immediately shift user traffic, Shadow Deployment mirrors real-time traffic from the live production environment to the shadow instance.^[400-devops__06-Kubernetes__k8s-ithelp__Day12__README.md]

This approach simulates the production environment on the new version to verify stability and performance before it officially goes live.^[400-devops__06-Kubernetes__k8s-ithelp__Day12__README.md]

How It Works

In this setup, the new version runs in parallel with the old one.^[400-devops__06-Kubernetes__k8s-ithelp__Day12__README.md] Requests flowing into the original version are simultaneously distributed to the new version.^[400-devops__06-Kubernetes__k8s-ithelp__Day12__README.md]

Because the new version processes real traffic without serving actual users, the system is only switched to the new entry point after it meets release conditions, at which point the old version is terminated.^[400-devops__06-Kubernetes__k8s-ithelp__Day12__README.md]

Benefits

  • Performance Testing: It allows for direct performance testing using real production traffic without impacting the end-user experience.^[400-devops__06-Kubernetes__k8s-ithelp__Day12__README.md]
  • Safety: The application is only released to the public once it is verified to be stable and ready for launch.^[400-devops__06-Kubernetes__k8s-ithelp__Day12__README.md]

Drawbacks and Risks

  • Resource Costs: Similar to Blue/Green Deployment, this strategy requires double the resources to run both versions simultaneously.^[400-devops__06-Kubernetes__k8s-ithelp__Day12__README.md]
  • Complexity: The configuration is complex and prone to unexpected situations.^[400-devops__06-Kubernetes__k8s-ithelp__Day12__README.md]
  • Side Effects: Special care must be taken for non-idempotent operations. For example, if a request to place an order is routed to both the old and new versions, it could result in the order being placed twice.^[400-devops__06-Kubernetes__k8s-ithelp__Day12__README.md]

Sources

^[400-devops__06-Kubernetes__k8s-ithelp__Day12__README.md]