← All templates

Rolling or blue-green, health checks, automatic rollback.

Spec — Zero-downtime deploys

Status: draft · Created: 2026-11-10

1. Context and goal

New versions reach production during working hours without failed requests, and a bad version is undone before users notice.

2. Functional requirements (EARS)

  • FR-1: THE SYSTEM SHALL deploy a new version by rolling update or blue-green switch, keeping at least 100% of the required capacity serving at all times.
  • FR-2: THE SYSTEM SHALL send traffic to a new instance only after its readiness check passes 3 times in a row.
  • FR-3: WHEN an old instance is stopped, THE SYSTEM SHALL stop sending it new requests and let in-flight requests finish for up to 30 seconds.
  • FR-4: IF the error rate of the new version exceeds 1% or its 95th percentile latency doubles within 10 minutes of the rollout, THEN THE SYSTEM SHALL roll back automatically.
  • FR-5: WHEN a rollback is triggered, THE SYSTEM SHALL restore the previous version within 5 minutes and alert the team.
  • FR-6: THE SYSTEM SHALL keep database changes compatible with the previous version of the code during a rollout.
  • FR-7: THE SYSTEM SHALL record each deploy with the version, the person or pipeline that started it, the start and end time and the result.

3. Out of scope

  • Canary analysis with traffic splitting by user.
  • Multi-region failover.