MentorNode
Start free
Platform & InfrastructureMediumdesign-ci-cd-pipeline

Design a CI/CD Build & Deployment Pipeline

Design build and release for a large monorepo: a scheduler that only rebuilds what changed, ephemeral runners, artifact promotion, and deploys that roll back on their own.

Build CacheDAG SchedulingArtifact RegistryProgressive Rollout
Traffic & Capacity Estimates:

5k builds/day · 200 services · median build under 10 minutes · zero-downtime deploys

Functional Requirements

  • •Trigger builds on commit, resolve the dependency DAG, and skip targets whose inputs are unchanged.
  • •Run steps on isolated ephemeral runners with a shared remote cache.
  • •Publish immutable, versioned artifacts and promote the same artifact through environments.
  • •Deploy progressively (canary, blue-green) with automatic rollback on health signals.

Non-Functional Requirements

  • •Builds must be reproducible — the same inputs produce the same artifact.
  • •A poisoned or compromised build must not be promotable to production.
  • •Queue wait under 60 seconds at peak commit hours.

Back-of-the-Envelope Math

  • 5k builds/day clustered into an 8-hour workday = ~10 builds/minute, with merge-queue bursts well above that.
  • A remote cache with an 80% hit rate turns a 40-minute cold monorepo build into roughly 8 minutes.

Key Architectural Trade-offs

  • Content-addressed remote caching is the single biggest build-time win and demands genuinely hermetic, side-effect-free build steps.
  • Ephemeral runners give clean, secure builds and pay a provisioning cost per job; persistent runners are fast and accumulate state that breaks reproducibility.
  • Canary deploys catch bad releases with real traffic and require two versions to coexist — which pushes backward-compatible schema changes onto every team.

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