Replace old servers with new ones a few at a time, so the service never stops.
A rolling deployment replaces the old version with the new one a few servers at a time, so the service keeps running the whole time.
Imagine you run 8 servers behind a load balancer. The simplest upgrade is to stop all 8 and start 8 new ones, but that means downtime. A rolling update does it in batches. While batch one is being upgraded, the other servers still answer every request.
Each batch goes through the same steps. First drain: the load balancer stops sending new requests, and running requests are allowed to finish. Then replace: start the new version. Then check: wait until a readiness check passes. Only then does the server join the pool and take traffic.
| Setting | What it controls | Effect |
|---|---|---|
| Batch size (max unavailable) | How many servers are out of service at once | Bigger is faster, but lowers capacity during the update |
| Surge (max extra) | How many extra servers can be started above the normal count | Keeps capacity up, costs a little more for a while |
| Readiness check | A test that must pass before a server gets traffic | Stops a bad version from spreading |
| Drain time | How long running requests get to finish | Too short cuts requests, too long slows the update |
| Min ready time | How long a server must stay healthy before the next batch | Catches problems that appear a little later |
| Progress deadline | How long the rollout may take before it counts as failed | Turns a stuck rollout into an alarm |
A simplified model: servers have equal capacity, and requests are shared evenly between the servers that are serving. Real platforms add surge servers, timeouts and retries on top of this.
| Term | Meaning in easy words |
|---|---|
| Rolling update | Replacing servers with a new version in small batches |
| Batch | The group of servers changed at the same time |
| Connection draining | Letting running requests finish before a server stops |
| Readiness check | A test that tells the load balancer the server can take traffic |
| Liveness check | A test that tells the platform the process is alive or must be restarted |
| Surge | Extra servers started above the normal count during an update |
| Max unavailable | How many servers may be out of service at once |
| Graceful shutdown | Stopping a server cleanly: finish work, close connections, then exit |
| Stateless | A server that keeps no user data between requests |
| Mixed-version state | The time when old and new versions run together |
| Roll forward / back | Moving to the newer version, or returning to the older one |
| Choice | We gain | We lose |
|---|---|---|
| Bigger batch | A faster rollout | Lower capacity, bigger blast radius |
| Smaller batch | Higher capacity, smaller blast radius | A slower rollout |
| Surge servers | Full capacity throughout | A little extra cost, and room is needed |
| Long drain time | Fewer cut requests | A slower update |
| Strict readiness check | Bad versions stopped early | Risk of a stuck rollout if the check is too picky |
| Rolling vs blue-green | Lower cost | Slower rollback, and mixed versions |