ASP.NET Core Interview Question #223
What is a blue-green deployment?
Testing, Deployment & Hosting Senior Advanced
Quick Interview Answer
Blue-green deployment maintains two separate production-capable environments. One environment serves live traffic while the other receives the new release and is validated.
Detailed Explanation
Blue-green deployment maintains two separate production-capable environments. One environment serves live traffic while the other receives the new release and is validated.
Traffic is then switched to the new environment. If serious problems appear, traffic can often be redirected back quickly, provided data and schema changes remain compatible.
The approach can reduce release downtime but requires additional infrastructure and careful handling of databases, background jobs, caches, and external side effects.
Code Example
// Conceptual flow:
// Blue -> currently live
// Green -> deploy and validate new release
// Switch router/load balancer to Green
// Keep Blue temporarily available for rollback