Preparing your design workspace

Loading the problem and your latest saved attempt…

Design a Fleet Software Deployment and Orchestration System

Roll a new release of a service out to thousands of hosts in health-checked waves, stop and roll back automatically when something breaks, and always know which version each host is really running.

Problem statement

Design the internal system that service teams use to deploy new software to the fleets of hosts that run their services.

For this exercise, assume about 2,000 services run on about 500,000 hosts spread across 3 regions, each with 3 availability zones. Every host runs a small deployment agent that the system can talk to. A team first registers a release: an immutable, versioned build artifact for its service.

It then starts a deployment of that release to the service's fleet.

For this exercise, assume a deployment moves through fixed waves in this order: one canary host, then the rest of the first zone, then the other two zones of the first region, then the second region, and finally the third region.

After the canary and after each later wave except the last, the deployment waits through a bake period while it watches health before it starts the next wave. Updating one host means taking it out of the load balancer, installing and starting the new version, passing health checks, and putting it back.

While this happens, at most 10% of a service's hosts in any one zone may be out of service, and that count includes hosts that are already unhealthy for other reasons.

The deployment must stop automatically when host health checks or the service's alarms fail, and it must roll already-updated hosts back to the previous release. Operators can pause, resume, or roll back by hand. A service has at most one active deployment at a time, and a newer deployment replaces an older one.

A host counts as updated only after it reports that it is running the new version and passing health checks; a sent command does not count. A timeout or a lost report leaves a host's state unknown. Building the artifact, statistical canary analysis, container scheduling, and database schema changes are out of scope.

What to build

  1. A team can register an immutable, versioned release for its service and start a deployment of that exact release to the service's fleet.
  2. The deployment moves through ordered waves, from one canary host to whole regions, and never takes more than 10% of a service's hosts in any zone out of service at once.
  3. The deployment stops automatically when health checks or alarms fail during a wave or its bake period and rolls updated hosts back to the previous release; operators can also pause, resume, or roll back.
  4. Teams can see, for each deployment and each host, the release it should run, the release it reports running and healthy, and which hosts are in an unknown state.

At scale

  • For this exercise, assume about 2,000 services and 500,000 hosts across 3 regions with 3 zones each; the largest service has 9,000 hosts, about 1,000 per zone.
  • For this exercise, assume updating one host takes about 5 minutes, the canary bake lasts 30 minutes, and each later bake lasts 1 hour.
  • For this exercise, assume a routine deployment of the largest service must finish within an 8-hour working day, and a rollback must return every updated host to the previous release within 1 hour.
  • For this exercise, assume each agent reports every 30 seconds, a host silent for 5 minutes is treated as unknown, and about 0.5% of hosts are unhealthy at any time for reasons unrelated to deployments.