Rainbow deployments for stateful services
TIL about Rainbow deployments, a generalization of blue/green deployments. The goal is to minimize disruptions to users when updating to new deployments. In a nutshell, every time you create a new deployment, you call it something like my-deployment-$NEW_SHA. When it's up, you start directing new traffic to it, rolling back to my-deployment-$OLD_SHA if needed. However, you don't delete the green deployment yet, since there are active stateful sessions running on it still. Once most of the sessions connected to the old deployments have naturally burnt down, you can delete the old deployments, and the few remaining sessions re-connect on the newest deployment.