Zero-downtime deployment for a Spring Boot application is commonly achieved with a blue-green deployment strategy, which keeps two identical production environments and switches traffic between them.
An e-commerce checkout flow stays fully available during a release because the new version is deployed and verified on the green environment first, and the switch-over happens instantly at the router, with blue kept warm as an immediate rollback target.
# application.yml: finish in-flight requests before stopping
server:
shutdown: graceful
spring:
lifecycle:
timeout-per-shutdown-phase: 30s
management:
endpoint:
health:
probes:
enabled: true
# Kubernetes Deployment (excerpt)
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 0
maxSurge: 1
template:
spec:
containers:
- name: app
readinessProbe:
httpGet: { path: /actuator/health/readiness, port: 8080 }
lifecycle:
preStop:
exec: { command: ["sh", "-c", "sleep 10"] } # let the load balancer drainA concise interview answer is
I'd use blue-green deployment: deploy the new version to an idle environment, run health checks and smoke tests against it, then switch traffic over at the load balancer once it's verified. Keeping the old environment live but idle gives an instant rollback path if anything goes wrong.
Last updated: 1 November 2026
Next question: What are the basic commands to build a Docker image, and where do you store Docker images?