0Pricing
Edge Computing with Cloudflare Workers & Deno · レッスン

Blue-Greenデプロイと段階的ロールアウト

Blue-Greenデプロイと段階的なトラフィック移行を使ってエッジアプリケーションを安全にデプロイし、リスクを最小化して即時ロールバックを可能にします。

「Blue-Greenデプロイと段階的ロールアウト」はCoddyKit上の無料Edge Computing with Cloudflare Workers & Denoレッスンです。 これはレッスン4/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これはEdge Computing with Cloudflare Workers & Deno学習パスの一部であり、ウェブとCoddyKitアプリ全体で進捗が同期されます。 Edge Computing with Cloudflare Workers & Denoコースには全4レッスンが含まれています。

このレッスンの一部はまだ翻訳されておらず、英語で表示されています。

The Risk of Big-Bang Deploys

Shipping a new version to 100% of users at once is risky, a hidden bug hits everyone instantly.

Progressive deployment strategies reduce blast radius by exposing changes gradually and enabling fast rollback.

Blue-Green Deployments

In a blue-green setup you run two environments:

  • Blue, the current live version
  • Green, the new version, fully deployed but not yet receiving traffic

You switch traffic to green when ready, and switch back instantly if something breaks.

Gradual (Canary) Rollouts

A gradual rollout sends a small percentage of traffic to the new version first, then increases it as confidence grows.

  • 5% then 25% then 50% then 100%
  • Watch error rates at each step

Also called a canary release.

Versioned Uploads

Cloudflare lets you upload a new Worker version without deploying it to all traffic.

wrangler versions upload
# uploads a new version, 0% traffic by default

Splitting Traffic by Percentage

Use gradual deployments to assign a percentage of requests to each version.

wrangler versions deploy \
  <new-version-id>@10% <old-version-id>@90%

Manual Routing for Control

For custom logic you can route in code, for example send a cohort to the new behavior based on a hash of the user ID.

function inCanary(userId) {
  // simple stable bucketing
  return (userId.charCodeAt(0) % 100) < 10; // ~10%
}

Watch the Right Metrics

During a rollout, monitor:

  • Error rate / 5xx responses
  • Latency (p50, p95, p99)
  • CPU time
  • Business KPIs

Compare the new version against the baseline before increasing traffic.

Instant Rollback

The key benefit of progressive deploys is fast rollback, shift traffic back to the known-good version immediately.

wrangler versions deploy <old-version-id>@100%

Automating Rollback

Tie rollout steps to CI checks. If error rates exceed a threshold, the pipeline automatically reverts to the previous version.

if (errorRate > 0.02) {
  await rollbackToPrevious();
}

Database Compatibility

During blue-green, both versions may run at once, so schema changes must be backward compatible.

  • Add columns before removing old ones
  • Use expand-then-contract migrations

Best Practices Summary

Deploy safely at the edge by:

  • Uploading versions without full deploy
  • Splitting traffic gradually and watching metrics
  • Keeping rollback one command away
  • Making migrations backward compatible

Quick Check

What is the defining characteristic of a canary (gradual) rollout?

Recap

You learned safe deployment strategies:

  • Blue-green keeps a hot standby for instant switching
  • Gradual rollouts shift traffic in steps while you watch metrics
  • Versioned uploads and percentage splits make this easy on Cloudflare
  • Backward-compatible migrations keep both versions healthy

Progressive delivery turns scary deploys into routine, reversible events.

よくある質問

「Blue-Greenデプロイと段階的ロールアウト」レッスンは無料ですか?

はい。「Blue-Greenデプロイと段階的ロールアウト」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、Edge Computing with Cloudflare Workers & Denoコースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 Edge Computing with Cloudflare Workers & Denoコースには全4レッスンが含まれています。

「Blue-Greenデプロイと段階的ロールアウト」で何を学びますか?

Blue-Greenデプロイと段階的なトラフィック移行を使ってエッジアプリケーションを安全にデプロイし、リスクを最小化して即時ロールバックを可能にします。 ブラウザで直接実行するハンズオンコードでEdge Computing with Cloudflare Workers & Denoを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。

Edge Computing with Cloudflare Workers & Denoを始めるのに経験は必要ですか?

事前経験は必要ありません。CoddyKitのEdge Computing with Cloudflare Workers & Denoは初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン4/4です。

「Blue-Greenデプロイと段階的ロールアウト」レッスンにはどのくらい時間がかかりますか?

ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。

このEdge Computing with Cloudflare Workers & Denoレッスンでコードを書いて実行できますか?

はい。すべてのEdge Computing with Cloudflare Workers & Denoレッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。

このコースのすべてのレッスン

  1. Deno DeployとCLI
  2. カスタムランタイム環境
  3. エッジ向けテストとCI/CD
  4. Blue-Greenデプロイと段階的ロールアウト
← Edge Computing with Cloudflare Workers & Denoに戻る