Back to all terms
ServerNode 1Node 2Infrastructure
Infraintermediate

Zero-Downtime Deployments

Deploy application updates without any period of unavailability by gradually replacing old instances with new ones.

Also known as: rolling deployments, zero downtime, rolling updates, no-downtime deployment

Description

Zero-downtime deployment is the practice of releasing new application versions without any interruption to end users. This is achieved by running old and new versions simultaneously during the transition period, gradually shifting traffic from old instances to new ones while monitoring for errors. The approach requires that the application, database schema, and APIs support running two versions concurrently.

Rolling deployments are the most common strategy: instances are updated one at a time (or in small batches), with each new instance passing health checks before the next old instance is taken down. Kubernetes implements this via Deployment resources with configurable maxSurge (extra instances during update) and maxUnavailable (instances that can be offline). The combination of maxSurge=1 and maxUnavailable=0 ensures capacity never drops below the desired replica count.

Critical prerequisites for zero-downtime deployments include backward-compatible database migrations (additive schema changes, not destructive), API versioning or backward-compatible changes, graceful shutdown in application code, properly configured health checks that only pass when the new version is ready to serve traffic, and sufficient load balancer drain time. Session management must be externalized (not stored in-process) so that sessions survive instance replacement.

Prompt Snippet

Configure rolling deployments with zero downtime: set Kubernetes Deployment strategy to RollingUpdate with maxSurge=1 and maxUnavailable=0. Ensure readiness probes pass only after full initialization (database connection pool warmed, caches primed). Set the load balancer's deregistration delay to 30s to drain in-flight connections. Require all database migrations to be backward-compatible (add columns as nullable, never rename/drop columns in the same release as code changes). Implement a deployment checklist gate that verifies API contract compatibility between old and new versions using consumer-driven contract tests.

Tags

deploymentavailabilityrolling-updatedevopszero-downtime