Zero Downtime Deployment is the practice of updating an application without interrupting operation and making it unavailable to users. This is achieved by sequentially taking out old instances and introducing new ones.
An example implementation for a stateless application in the cloud (for instance, using Kubernetes):
Example deployment.yaml with rolling update:
apiVersion: apps/v1 kind: Deployment metadata: name: my-app spec: replicas: 4 strategy: type: RollingUpdate rollingUpdate: maxSurge: 1 maxUnavailable: 1 template: metadata: labels: app: my-app spec: containers: - name: app image: my-app:v2
Key features:
Is Zero Downtime Deployment impossible when changing the data schema?
It is possible if schema migrations are done in two steps: first, the code becomes compatible with both the old and new schema, then the migration itself and removal of legacy code.
If the application is stateless, is zero downtime deployment always guaranteed?
No! The limiting factor can be external state, connection timeouts, unprocessed requests, or unsupported reverse-incompatible changes in the API.
Is Zero Downtime Deployment only needed by large companies?
No. Even small startups and SaaS solutions require zero downtime as a critical factor for user experience (especially in global markets and high-load scenarios).