Back to articles
Zero-Downtime Deployment — How to Deploy Without Dropping a Single Request
How-ToDevOps

Zero-Downtime Deployment — How to Deploy Without Dropping a Single Request

via Dev.to DevOpsEmpellio.com

Every time you deploy, you have a choice: take the app down briefly or keep it up. For most production systems, downtime — even 5 seconds — is unacceptable. This guide covers the techniques that make zero-downtime deployments possible, from the simplest single-server setup to multi-server strategies. Why Deployments Cause Downtime The naive deploy sequence looks like this: # Bad — causes downtime pm2 stop api git pull npm run build pm2 start api Between stop and the new process starting and passing health checks, your app is down. Connections get refused. Users see errors. Load balancers fail health checks and trigger alerts. Even if the downtime is 2 seconds, it shows up in your error rate and p99 latency graphs. The Three Prerequisites Zero-downtime deployment requires three things from your application: 1. Graceful shutdown — the app must finish in-flight requests before exiting. If it doesn't, requests that hit the dying instance get cut off. 2. Fast startup — the new instance must

Continue reading on Dev.to DevOps

Opens in a new tab

Read Full Article
3 views

Related Articles