Practice this topic in a realistic system design interview
When a new version breaks in production, the first question is simple: how fast can we get users back to the last working version?
Blue-green deployment is built around that question. You run two production environments side by side. Blue serves users right now. Green runs the new version.
Once green is ready, you move traffic from blue to green. Blue stays available for a while, so if green has a serious problem, you can move traffic back quickly.
The trade-off is cost. For a short time, you need enough infrastructure to run two full environments.
This chapter explains how the traffic switch works, how to check green before users reach it, why databases and long-lived connections make blue-green harder, and when the fast rollback is worth the extra infrastructure.