MentorNode
Start free
Platform & InfrastructureHarddesign-global-deployment

Design a Global Code Deployment System

Design how a build reaches a hundred thousand machines across every region: efficient artifact distribution, staged waves gated on health, and a rollback that beats the outage.

Artifact DistributionStaged RolloutHealth GatingAutomatic Rollback
Traffic & Capacity Estimates:

100k hosts · 20 regions · 1 GB artifacts · full fleet rollout within 2 hours

Functional Requirements

  • •Distribute large artifacts to every region without saturating inter-region links.
  • •Roll out in waves — canary, single region, then broad — gated on health metrics at each step.
  • •Detect regressions automatically from error rate, latency, and business metrics.
  • •Roll back to the previous known-good version faster than it was deployed.

Non-Functional Requirements

  • •A bad deploy must be detected and halted before it reaches more than a small percentage of traffic.
  • •Rollback must complete in minutes and must never require a rebuild.
  • •The deployment system must keep working when the thing being deployed is broken.

Back-of-the-Envelope Math

  • 1 GB artifact * 100k hosts = 100 TB of transfer per rollout if pulled naively from one origin.
  • Regional mirrors or peer-to-peer distribution cut inter-region transfer from 100 TB to roughly 20 GB.

Key Architectural Trade-offs

  • Fast full-fleet rollouts ship value sooner and shorten the window in which a regression is caught in only one wave — speed directly trades against blast radius.
  • Automated rollback on metric regressions catches real failures and occasionally reverts a healthy deploy during unrelated noise; the threshold is a judgement call.
  • Immutable artifacts promoted through environments guarantee what you tested is what runs, and forbid the config-patch shortcut teams reach for under pressure.

Click or drag a component onto the canvas, then connect the handles to draw the data flow.

3 nodes · 2 edges

Components · 35

Client & Edge4
Compute & Gateway7
Storage & Caching11
Messaging & Streaming6
Coordination & Ops5
Intelligence2
Canvas overview