Recreate, rolling, blue/green, canary, shadow and feature flags compared on rollback, cost, what each needs from the application, and what bites people.
Rolling update
3 requirements of the application.
Instances are replaced a few at a time. Kubernetes does this by default: maxSurge controls how many extra may exist, maxUnavailable how many may be missing, and the rollout waits for each new pod to become Ready before continuing.
Roll the previous version back out the same way, which takes about as long as the deploy. Part way through a rollback both versions are serving, exactly as during the deploy.
A little extra capacity — maxSurge worth — for the duration. Usually a few percent.
The default for a stateless service. It needs almost no extra capacity and no routing machinery.
There is no single moment when the deploy is 'done but reversible'. A problem that only appears under load is discovered when most instances are already replaced, and getting back takes a full rollout. A readiness probe that returns healthy before the service can actually serve turns a rolling update into a rolling outage.
Rollback is the question that decides this and most comparisons bury it. Every strategy can deploy; they differ by orders of magnitude in how you get back — one routing change for blue/green, a second full rollout for rolling, no deploy at all for a feature flag. The other constraint worth checking before you choose: every strategy except recreate needs two versions able to serve at once, which in practice means the database schema has to satisfy both. This is reference text; nothing is deployed and no platform is contacted.
Deployment Strategy Reference runs entirely on your device — this is maintained reference text, and no deployment platform is contacted.
You’re on the Free plan. Compare plans
Rollback is the deciding question and most comparisons bury it. Every strategy can deploy; they differ enormously in how you get back. Blue/green rollback is one routing change to an environment that is still running and still warm — seconds. Rolling rollback is a second full rollout, which takes as long as the deploy did. A feature flag is fastest of all, because it needs no deploy at all.
Each one also states what it requires of the application, which is where the real constraint usually lives. Every strategy except recreate needs two versions able to serve simultaneously, which in practice means the database schema has to satisfy both — and that is the requirement people discover after choosing.
And each names its pitfall. Blue/green does not duplicate the database, so a migration applied for green is live for blue, and that is exactly what a rollback cannot undo. A canary at 1% of traffic produces too few samples to distinguish a one-in-a-thousand problem from noise for a long time. A shadow that sends an email sends it for real, because the response being discarded does not undo the side effect.
Recreate is included and treated seriously rather than dismissed. It is the only strategy that requires nothing of the application and needs no extra capacity, which makes it right for a migration that is not backward compatible or a worker that cannot run twice.
This is reference text. Nothing is deployed and no platform is contacted.
They answer different questions. Blue/green buys a near-instant rollback at the cost of double capacity, and suits a release where certainty matters more than money. Canary buys evidence from real traffic at the cost of a slow ramp and traffic-splitting machinery, and suits a change whose risk is behavioural.
Because the database is usually not duplicated. Switching traffic back to blue is instant, but a migration applied for green is still applied — so "two independent environments" is not quite true, and schema changes have to be backward compatible anyway.
Nothing, except that it is a statistical process and 1% of traffic produces very few samples. A problem affecting one request in a thousand takes a long time to distinguish from noise at that share, so the ramp has to be slow enough for the numbers to mean something. Sticky sessions make it worse by keeping the same users on the canary.
Yes — when two versions cannot run at once. A schema migration that is not backward compatible, a singleton worker, a service holding an exclusive lock. It is the only strategy that imposes no requirement on the application, and the cost is paid entirely in a short, predictable outage.