Edge Computing with Cloudflare Workers & Deno · Lezione

Deployment blue-green e rollout graduali

Distribuite le applicazioni edge in sicurezza usando deployment blue-green e rollout graduali del traffico, per ridurre al minimo i rischi e consentire un rollback immediato.

Lezione 4 di 413 passaggi

Deployment blue-green e rollout graduali è una lezione Edge Computing with Cloudflare Workers & Deno gratuita su CoddyKit. Questa è la lezione 4 di 4. Puoi leggere la lezione completa qui gratuitamente — poi esercitati direttamente nel browser con un editor di codice integrato e un tutor IA disponibile 24/7. Fa parte del percorso di apprendimento Edge Computing with Cloudflare Workers & Deno, e i tuoi progressi si sincronizzano tra il web e l'app CoddyKit. Il corso Edge Computing with Cloudflare Workers & Deno include 4 lezioni in totale.

Parti di questa lezione non sono ancora state tradotte e vengono mostrate in inglese.

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.

Gratis per iniziare

Impara Edge Computing with Cloudflare Workers & Deno con un tutor IA — gratis

Scrivi ed esegui vero codice nel tuo browser, ricevi aiuto istantaneo da un tutor IA disponibile 24/7, e riprendi da dove hai lasciato sul web o nell'app.

Corsi
12
Lezioni
47

Domande Frequenti

La lezione «Deployment blue-green e rollout graduali» è gratuita?

Sì — il testo completo di «Deployment blue-green e rollout graduali» è gratuito qui sul web. Per esercitarvi in modo interattivo (un editor di codice integrato e un tutor IA 24/7) e sbloccare il resto del corso Edge Computing with Cloudflare Workers & Deno, passa a CoddyKit PRO. Il corso Edge Computing with Cloudflare Workers & Deno include 4 lezioni in totale.

Cosa imparerò in «Deployment blue-green e rollout graduali»?

Distribuite le applicazioni edge in sicurezza usando deployment blue-green e rollout graduali del traffico, per ridurre al minimo i rischi e consentire un rollback immediato. Eserciti Edge Computing with Cloudflare Workers & Deno con codice pratico che esegui direttamente nel browser, e un tutor IA 24/7 risponde alle tue domande mentre lavori sulla lezione.

Ho bisogno di esperienza per iniziare Edge Computing with Cloudflare Workers & Deno?

Non è richiesta alcuna esperienza precedente. Edge Computing with Cloudflare Workers & Deno su CoddyKit è strutturato per principianti e studenti avanzati, quindi puoi iniziare da qui o dall'inizio e procedere al tuo ritmo. Questa è la lezione 4 di 4.

Quanto tempo richiede la lezione «Deployment blue-green e rollout graduali»?

La maggior parte delle lezioni CoddyKit richiede circa 5–10 minuti. Ogni lezione è breve e interattiva, quindi fai progressi costanti e riprendi esattamente da dove hai lasciato su web e app.

Posso scrivere ed eseguire codice in questa lezione Edge Computing with Cloudflare Workers & Deno?

Sì. Ogni lezione Edge Computing with Cloudflare Workers & Deno include un editor di codice integrato, quindi scrivi ed esegui codice reale direttamente nel tuo browser e ricevi feedback istantaneo dall'IA — nessuna configurazione locale necessaria.

Tutte le lezioni di questo corso

  1. Deno Deploy e CLI
  2. Ambienti di runtime personalizzati
  3. Testing e CI/CD per l'edge
  4. Deployment blue-green e rollout graduali
← Torna a Edge Computing with Cloudflare Workers & Deno