デプロイメントが問題を引き起こす場合、ユーザーへの影響を最小限に抑えるために、動作している状態に迅速にロールバックする必要があります。効果的なロールバック戦略、および関連する監視、自動ロールバック、前方修正の実践は、信頼性の高いデプロイメントに不可欠です。
なぜ重要なのか
Deployments sometimes introduce problems (bugs, errors, performance issues) that get
through testing. When that happens in production:
→ you need to restore a WORKING state QUICKLY (minimize user impact/downtime)
→ a fast, reliable rollback is essential — being able to undo a bad deploy fast
→ "How do we roll back?" must be answered BEFORE you need it.
ロールバックのアプローチ
✓ REDEPLOY the previous version — deploy the last known-good artifact/version
(versioned artifacts make this easy: deploy v1.2.2 to undo v1.2.3)
✓ BLUE-GREEN → instant rollback by switching traffic back to the old environment
✓ CANARY → if the canary shows problems, stop the rollout (only a few users affected)
✓ Database changes → trickier (need backward-compatible migrations; see below)
✓ Feature FLAGS → disable a problematic feature without redeploying (instant "rollback"
of behavior)
