Despliegues blue-green y progresivos
Despliegue aplicaciones edge de forma segura mediante despliegues blue-green y lanzamientos progresivos de tráfico para minimizar el riesgo y permitir un rollback inmediato.
Despliegues blue-green y progresivos es una lección gratuita de Edge Computing with Cloudflare Workers & Deno en CoddyKit. Esta es la lección 4 de 4. Puedes leer la lección completa abajo gratuitamente — luego la practicas en el navegador con un editor de código integrado y un tutor de IA 24/7. Forma parte de la ruta de aprendizaje de Edge Computing with Cloudflare Workers & Deno, y tu progreso se sincroniza en la web y la app de CoddyKit. El curso de Edge Computing with Cloudflare Workers & Deno incluye 4 lecciones en total.
Partes de esta lección aún no han sido traducidas y se muestran en inglés.
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 defaultSplitting 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.
Preguntas frecuentes
¿La lección «Despliegues blue-green y progresivos» es gratis?
Sí — el texto completo de «Despliegues blue-green y progresivos» es gratis para leer aquí en la web. Para practicarla de forma interactiva (editor de código integrado y tutor de IA 24/7) y desbloquear el resto del curso de Edge Computing with Cloudflare Workers & Deno, actualiza a CoddyKit PRO. El curso de Edge Computing with Cloudflare Workers & Deno incluye 4 lecciones en total.
¿Qué aprenderé en «Despliegues blue-green y progresivos»?
Despliegue aplicaciones edge de forma segura mediante despliegues blue-green y lanzamientos progresivos de tráfico para minimizar el riesgo y permitir un rollback inmediato. Practicas Edge Computing with Cloudflare Workers & Deno con código real que ejecutas directamente en el navegador, y un tutor de IA 24/7 responde tus preguntas mientras trabajas en la lección.
¿Necesito experiencia previa para empezar Edge Computing with Cloudflare Workers & Deno?
No se requiere experiencia previa. Edge Computing with Cloudflare Workers & Deno en CoddyKit está estructurado para principiantes hasta estudiantes avanzados, así que puedes empezar aquí o desde el inicio y avanzar a tu ritmo. Esta es la lección 4 de 4.
¿Cuánto tiempo toma la lección «Despliegues blue-green y progresivos»?
La mayoría de las lecciones de CoddyKit toman alrededor de 5–10 minutos. Cada una es compacta e interactiva, así que avanzas constantemente y retomas exactamente por donde dejaste en la web y la app.
¿Puedo escribir y ejecutar código en esta lección de Edge Computing with Cloudflare Workers & Deno?
Sí. Cada lección de Edge Computing with Cloudflare Workers & Deno incluye un editor de código integrado, así que escribes y ejecutas código real directamente en tu navegador y obtienes retroalimentación instantánea de IA — sin configuración local necesaria.
Todas las lecciones de este curso
- Deno Deploy y CLI
- Entornos de ejecución personalizados
- Pruebas y CI/CD para el edge
- Despliegues blue-green y progresivos