Why a restart is downtime
Friday afternoon, you run docker compose up for a small release. Ten seconds later the error alerts arrive. Nothing crashed — the app simply did not exist for a moment during the swap. That is downtime.
The titikterang app answers on one port. When you run docker compose down and then up, there is a stretch with no process listening. Requests in that second fail. "Only a few seconds" feels long under real traffic.
The stop-start gap
The sequence is always the same: stop the old process, pull the new image, start the new process, wait until healthy. Traffic does not wait politely — a reverse proxy still pointing at an empty port returns errors to your users.
Think of swapping a light bulb: however small the swap, the room goes dark while the old bulb is out and the new one is not in yet. Zero-downtime means turning the new bulb on first, then switching the old one off.
- The container is up and requests pass.
- The container is stopped. Requests fall into the gap.
- A new container is starting. Traffic is still empty.
- The container is healthy again. Readers already felt the pause.
Quick recap
- Downtime happens in the gap between the old process stopping and the new one being ready — not because of a crash.
- A restart policy helps crashes, not deliberate deploys.
- Zero-downtime does not mean no work; the work moves to a side users cannot see.
The next chapter adds a second slot so the gap moves to the idle side. Lab files live in examples/titikterang.