How do you design a pipeline for a monorepo with 50 services?
AdvancedProductionPipeline Design and Architecture
Answer
Compute affected services per change and only build, test and deploy those. Options: path filters for simple layouts, or a build graph (Nx, Turborepo, Bazel, Pants) with a remote cache so unchanged targets are never rebuilt. A planning job outputs a JSON list of changed services; a matrix fans out over it; a single gate job aggregates results for branch protection.
Other must-haves: shared libraries trigger rebuilds of all dependents; a full build on a schedule to catch graph mistakes; per-service deployment so one team's failure does not block others; CODEOWNERS per directory. Without these, the monorepo pipeline becomes the bottleneck for the whole company.
More on Pipeline Design and Architecture
What does a good production CI/CD pipeline look like end to end?BeginnerWhat is your target feedback time for CI and how do you hit it?IntermediateHow do you structure repositories: app repo, config repo, pipeline library?IntermediateShould every merge to main deploy to production automatically?IntermediateHow do you keep pipeline definitions DRY across hundreds of repos?IntermediateHow do you make a pipeline idempotent and safe to re-run?Intermediate