Rolling Deployment
debt(d7/e5/b5/t7)
Closest to 'only careful code review or runtime testing' (d7). Kubernetes/Helm config can be inspected, but mixed-version compatibility issues during rollout typically only surface via Datadog monitoring or staging tests, not automated detection.
Closest to 'touches multiple files / significant refactor in one component' (e5). The quick_fix is a config tweak (e1), but properly supporting rolling deploys requires backward-compatible migrations and API contracts across the app — a multi-file refactor.
Closest to 'persistent productivity tax' (b5). Every schema change and API change must now be designed for mixed-version coexistence, slowing many work streams across web/api contexts.
Closest to 'serious trap' (t7). The misconception is explicit: developers assume rolling is universally safer than blue-green, but mixed-version exposure contradicts that intuition and can break users mid-deploy.
Also Known As
TL;DR
Explanation
A rolling deployment updates servers sequentially — draining a server of active connections, deploying the new version, verifying health, then moving to the next. At any point during the rollout, both old and new versions serve traffic simultaneously. This means: database migrations must be backward compatible with both versions, API contracts must not have breaking changes, and feature flags may be needed to gate new behaviour. Rolling deployments are simpler than blue/green (no duplicate infrastructure) but slower to roll back — you must roll forward through the remaining servers or trigger a reverse rolling update. Kubernetes performs rolling updates natively via Deployment resources.
Common Misconception
Why It Matters
Common Mistakes
- Database migrations that break the old code version — both versions run simultaneously during a rolling deploy.
- Not handling mixed-version traffic in the application — old and new API contracts must coexist during rollout.
- Rolling too fast — updating all servers before monitoring shows the new version is healthy.
- No rollback plan — if the new version has issues, rolling back means going through the same process in reverse.
Code Examples
# Rolling deploy with breaking DB migration — causes errors:
# Step 1: Run migration that renames column 'user_name' to 'username'
# Step 2: Start deploying new code that uses 'username'
# Step 3: Old code still running on 50% of servers uses 'user_name' — errors!
# Fix: expand-contract — add 'username', dual-write, then remove 'user_name'
# Kubernetes — rolling update (default strategy)
apiVersion: apps/v1
kind: Deployment
spec:
replicas: 4
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 1 # at most 1 pod down at a time
maxSurge: 1 # at most 1 extra pod above replica count
template:
spec:
containers:
- name: app
image: myapp:v2.5.0 # change this to trigger rolling update
readinessProbe:
httpGet: { path: /health, port: 9000 }
# pod only receives traffic once /health returns 200
# kubectl rollout status deployment/myapp
# kubectl rollout undo deployment/myapp ← instant rollback