B. Blue Green a software delivery tutorial
Vol. I § Zero-downtime series § A series for junior developers
Zero-downtime delivery · 1 / 10 ·

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.

Slot playground · stop-start
readerCaddy :8080blue :18080 · upgreen :18081 · down
The container is up and requests pass.
  1. The container is up and requests pass.
  2. The container is stopped. Requests fall into the gap.
  3. A new container is starting. Traffic is still empty.
  4. 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.

Reader notes

Chapter discussion appears once Giscus is connected to the site repository.