Database migrations in deployments (Flyway/Liquibase, expand-contract), zero-downtime strategies, health checks and probes, configuration per environment, first-time cloud deployment, what Docker brings, post-deployment performance issues, blue-green in depth, speeding up deployments, and monitoring tools.
Published September 25, 2026
Zero-downtime deployment is where application code, database schema and infrastructure meet. The key idea interviewers probe is compatibility across versions. During a rollout, old and new instances run at the same time, against the same database.
Short answer:
-- V42__add_customer_email_normalized.sql (expand: safe with old and new code running together)
ALTER TABLE customer ADD COLUMN email_normalized VARCHAR(320);
CREATE INDEX CONCURRENTLY idx_customer_email_norm ON customer (email_normalized); -- PostgreSQL: no table lock
Key points to cover:
CONCURRENTLY.Short answer:
maxUnavailable: 0 and maxSurge: 1, so capacity never drops.server.shutdown=graceful, plus a preStop delay, so the load balancer stops sending traffic before the pod exits).Learn it in depth → Deployments & Rollouts
Short answer: Health checks let the platform decide automatically when to send traffic to an instance, and when to restart it. Without them, rollouts send users to instances that are still starting or already broken. Implement them with Spring Boot Actuator's probe groups:
/actuator/health/readiness): the app has started and can serve. Include the critical dependencies the app truly can't work without./actuator/health/liveness): the process isn't stuck. Don't include external dependencies here, or a database blip restarts every pod.readinessProbe: { httpGet: { path: /actuator/health/readiness, port: 8081 }, periodSeconds: 5, failureThreshold: 3 }
livenessProbe: { httpGet: { path: /actuator/health/liveness, port: 8081 }, periodSeconds: 10, failureThreshold: 3 }
startupProbe: { httpGet: { path: /actuator/health/liveness, port: 8081 }, periodSeconds: 5, failureThreshold: 30 }
Learn it in depth → Probes & Autoscaling
Short answer: One artifact, configuration injected per environment:
application.yml.Keep the environment configuration in Git (GitOps), reviewed like code, validated at startup (@Validated configuration properties), and rolled out as gradually as a code change.
Common trap: rebuilding the application per environment, or baking configuration into images. You then can't be sure that what you tested is what you ship.
Learn it in depth → Config & Secrets
Short answer:
Learn it in depth → Cost Awareness
Short answer:
Key points to cover:
Learn it in depth → Docker Fundamentals
Short answer (a model story): "Right after a release, p95 latency on the order API doubled, and database CPU rose sharply. The canary dashboards caught it. We rolled back within minutes, restoring the service, then compared traces from the two versions. The new version added a lazy-loaded association to a DTO mapping, which caused N+1 queries per order. We fixed it with a fetch join, added a query-count assertion to the integration test, and added a latency and error-rate analysis step to the canary, so a regression like that now fails the rollout automatically."
Key points to cover:
Short answer: You keep two identical production environments. Blue serves users, and green receives the new version. Once green passes its smoke tests and health checks, the load balancer switches all traffic to green. Blue stays up as an instant rollback target, and is then updated for the next release.
Advantages:
Costs:
Short answer: Measure each stage (queue time, build, tests, image build, push, deploy, rollout, verification), then attack the largest ones:
Track lead time for changes as a DORA metric.
Short answer:
Alerts are based on SLOs (the error rate and latency users experience), and they route to on-call rotations (PagerDuty, Opsgenie).
Learn it in depth → Monitoring in Production
Q: What are the four DORA metrics? A: Deployment frequency, lead time for changes, change failure rate, and time to restore service (MTTR). Together they measure both delivery speed and stability.
Q: Should Flyway run at application startup or as a separate job? A: Startup is simple, and Flyway's lock keeps concurrent instances safe. A separate pre-deploy job gives better control and clearer failure handling for large or risky migrations, and avoids slow startups. Many teams use a Kubernetes Job or init step for production.
Q: What does maxSurge/maxUnavailable control?
A: In a Kubernetes rolling update, maxSurge is how many extra pods may be created above the desired count, and maxUnavailable is how many may be unavailable during the rollout. maxUnavailable: 0 keeps full capacity throughout.
Q: What is a canary analysis? A: An automated comparison of the canary's metrics (error rate, latency) with the stable version's during a progressive rollout. The rollout is promoted automatically if the canary is healthy, and rolled back if it isn't.