Lesson 1 of 4
Move a Version with One Switch
Estimated time: 10 minutes
Let two builds answer at the same time
A change to a running system goes better when the part being replaced is not taken away first. If the old build is stopped before the new one is ready, there is a moment when nothing answers, and if the new build misbehaves, the thing that worked is already gone.
Run both builds together
Start the new build next to the old one and let both answer. Nothing goes dark, and the change can happen while every caller still has a working build. Warm the new one with copied requests first, so its early numbers are not skewed by a slow start.
def change_over(live, new):
old = live.active
live.active = new
return old
Compare on one shared measure
Before letting the old build go, read one shared measure, such as how often requests fail, on both sides. If the new build is worse, point the active slot back at the old one, which is the same single move in reverse.
Keep the old build until the new one holds
The old build is the way back. Releasing it at the moment of the change removes the option that made the change safe in the first place.