Monolithic vs Polyrepo Pipelines
One pipeline or many.
Monolithic pipeline pattern
Single CI pipeline runs every test, every check, every build for the whole repo.
Simple to understand; brutal at scale. A 1000-service monorepo cannot run every test on every commit.
Works up to ~20 services or modest test counts.
Polyrepo pipelines
Each service has its own pipeline. Independent CI for independent code.
Scales naturally; each pipeline is fast.
Cost: drift in tooling, duplicated config, harder cross-service refactors.
Selective pipelines (the modern monorepo pattern)
In a monorepo, only run tests for affected services. Bazel, Nx, Turborepo, Pants compute the affected set from the change set.
Best of both worlds: monorepo simplicity, scaled CI cost.
Requires good dependency tracking. Without it, the affected set is wrong and tests are skipped that shouldn't be.
Scaling each pattern
Monolithic: parallelize within the pipeline (matrix builds).
Polyrepo: shared CI templates, internal tooling team to keep them in sync.
Selective: invest in build graph correctness; the entire pattern depends on it.
How to pick
Single repo, under 20 services: monolithic pipeline.
Multiple repos: polyrepo with shared templates.
Monorepo above 20 services: selective pipelines with Bazel, Nx, or similar.