AI Hints
Home›CI/CD with GitHub Actions Tutorial›Deployment Strategies
CI/CD with GitHub Actions · Lesson 88 of 138

Deployment Strategies

How to switch versions.

⏱ 2 min read▶ Video at 1:41:50🎓 Free
Watch this lesson in the CI/CD with GitHub Actions courseWatch on YouTube ↗Full CI/CD with GitHub Actions course

Deploying means swapping the old version for the new one, while users keep using the app. How you do the swap decides how much can go wrong, and how fast you can undo it.

Deployment Strategies
From the video: Deployment Strategies
  • Swap old for new
  • Users keep using it
  • Risk and undo speed

Four strategies

Recreate stops everything, then starts the new version, so there's downtime. Rolling replaces servers a few at a time. Blue green runs two full copies, and switches traffic at once. Canary sends a small share of users to the new version first.

StrategyDowntime?Undo
Recreateyesredeploy old
Rollingnoroll back slowly
Blue-greennoswitch back instantly
Canarynostop the canary

Choosing one

For a small internal tool, recreate is fine. For most web apps, rolling is the default in tools like Kubernetes. Blue green costs twice the servers, but undo is instant. And canary is best when mistakes are expensive, and you can measure errors.

keyvalue
Recreatesimple, downtime
Rollingcommon default
Blue-greeninstant undo
Canarysafest, needs metrics

Summary

Recreate, rolling, blue green, and canary trade cost, speed, and safety. Next, a closer look at rolling deploys.

Key takeaways
  • Recreate
  • Rolling
  • Blue-green, canary
Next up: Rolling Deploys — a few at a time