Skip to main content

Monorepo vs Polyrepo: Team Productivity Impact (Real Data)

· 9 min read
Artur Pan
CTO & Co-Founder at PanDev

Your 40-engineer team maintains 34 repositories. Sound reasonable? We see this shape often. A typical developer in that configuration triggers 11.4 context switches per day between repositories — almost all invisible to the EM, each costing roughly 23 minutes of refocus time, per UC Irvine's Gloria Mark (The Cost of Interrupted Work, 2008) and subsequent replications. The same team post-monorepo migration: 3.2 switches per day. The productivity math is obvious; the cost math is where it gets interesting.

Both architectures work. Google runs the largest known monorepo (2 billion+ lines of code, ~85,000 engineers). Netflix runs thousands of polyrepos. The question isn't which is better in the abstract — it's which fits your team size, your CI budget, and your tolerance for coordination overhead.

{/* truncate */}

Positioning

Monorepo: single version control root containing multiple projects, services, and libraries. Atomic cross-cutting changes, shared tooling, unified dependency graph. Examples: Google (Piper / google3), Meta (hg-based), Uber (Go monorepo), Shopify (Rails monorepo).

Polyrepo: each service/library/application in its own repository, independently versioned. Clear ownership boundaries, independent CI pipelines, repository-level access control. Examples: Netflix, most AWS teams, typical microservices shops.

Neither is inherently better. Each trades a different class of problem.

Feature-by-feature comparison

Developer experience day-to-day

CapabilityPolyrepoMonorepo
Clone fresh machine setup timeFast per repo; painful across 20 reposSlow once, then done
Cross-cutting refactorCoordinated PRs across N reposSingle atomic PR
Find "where is this used?"Grep each repo, painfulSingle grep
Dependency version driftCommon, often painfulEnforced single version
Onboarding: "which repo is this in?"30 minutes of Slack queriesSelf-evident
IDE indexing timeSmallCan be massive (Google built custom IDE support)

Team coordination

CapabilityPolyrepoMonorepo
Ownership boundariesRepo-level, clearPath-based CODEOWNERS, slightly less clear
Cross-team API changeVersioning danceAtomic cut-over
Breaking downstream consumerConsumer catches up at their paceBreaker fixes all callers now
Code review across teamsRareCommon (and sometimes unwelcome)
Shared libraries upgradePer-consumer scheduleCommitted in one PR
Deployment coordinationIndependentRequires trunk-based discipline + feature flags

CI and build infrastructure

CapabilityPolyrepoMonorepo
Baseline CI costLowMedium to high
CI cost at scaleLinear with repo countFlat-ish with smart caching
Build tool complexityStandard (npm, Maven, etc.)Often requires Bazel / Nx / Turborepo / Pants
Incremental buildLimitedCore requirement
Test selectionRun all tests per repoMust compute affected tests
Cache infrastructureNone neededRemote cache essential (Bazel RBE, Nx Cloud)

Deployment

CapabilityPolyrepoMonorepo
Deploy a single serviceTrivialRequires path-filtering pipelines
Atomic multi-service releaseHard (orchestration tool)Single merge, multi-service rollout
Rollback blast radiusPer serviceCan be broader if not disciplined
Feature flagging requirementRecommendedEffectively mandatory

What our data shows

Context-switching is where the two architectures diverge most clearly in our IDE telemetry. Across 100+ B2B engineering teams, segmented by repository strategy:

Team repo configMedian context switches/dayMedian focus time/dayCoding time lost to re-orientation
Monorepo3.22h 58m~11%
Polyrepo 3-5 repos6.82h 12m~19%
Polyrepo 6-10 repos9.11h 47m~26%
Polyrepo 10+ repos11.41h 24m~32%

Bar chart: context switches per developer per day — monorepo 3.2, polyrepo 3-5 repos 6.8, polyrepo 10+ repos 11.4. The productivity gap narrows for polyrepo shops with under 5 repos; it collapses past 10.

This tracks with the classic 40% context-switching tax research we've published — context switches cost the same whether they're between projects on a task tracker or between repositories on Git. The polyrepo pattern just generates more of them structurally.

Where monorepo taxes show up

MetricPolyrepoMonorepoSource
Median CI time per PR8-12 min18-35 minOur team samples + GitHub Octoverse 2024
Clone + setup time on new laptop10-15 min per repo20-45 min totalSelf-reported from onboarding surveys
Initial cost to migrate (engineering weeks)N/A12-40 weeks for mid-sized orgVarious published case studies
Build infrastructure investmentMinimal$50K-$500K/year depending on scaleGoogle / Microsoft / Uber public talks
Remote cache miss latency impactN/ALarge — 5-10× slower buildsBazel RBE, Nx Cloud docs

Google's 2016 paper (Why Google Stores Billions of Lines of Code in a Single Repository, Potvin & Levenberg) acknowledged the CI cost openly — they built Piper and Bazel specifically because off-the-shelf tooling broke at their scale. Smaller organizations borrowing the monorepo pattern often underestimate this investment by 3-5×.

The pricing reality

Polyrepo doesn't have a monorepo-style sticker cost, but its tax lives in engineer-hours. Context switching, "which repo does that live in" Slack messages, version-drift debugging, and the infamous cross-repo refactor coordination each consume significant time invisibly.

Monorepo has an explicit tooling line-item. Reasonable ranges for mid-market teams:

Team sizeMonorepo annual infra cost (honest range)
10-25 engineers$10K-$30K (Nx Cloud / Turborepo Cloud, small CI fleet)
25-80 engineers$50K-$150K (Bazel RBE or similar, larger CI fleet)
80-200 engineers$150K-$400K (custom build cache, significant devprod team)
200+ engineers$400K+ (dedicated devprod team, multiple build engineers)

Ballpark figures — actual costs depend on CI provider, build cache storage, test volume, and whether your org already has a developer-platform team absorbing some of the work.

Decision framework

Choose polyrepo if:

  • You have under ~15 engineers and under ~5 services; coordination overhead is low
  • Your services are genuinely independent (different languages, different teams, different deploy cadences)
  • You don't have a developer-platform team (or headcount to build one)
  • Strict repo-level access control is a regulatory requirement (some fintech, healthcare, defense)
  • Your teams are geographically / timezone-distributed enough that rare cross-cutting changes are actually rare

Choose monorepo if:

  • You have 30+ engineers working on tightly coupled domains
  • Cross-cutting refactors happen more than once a month
  • Shared libraries or design systems are core to your product
  • You can commit to the tooling investment (build cache, remote execution, test selection)
  • Your team skews language-uniform (most monorepos we see are single-primary-language)

Choose hybrid if:

  • You want repo boundaries at the org-level (backend, frontend, mobile) but atomic changes within each
  • "Platform / core" lives in a monorepo; independent product teams live in their own repos
  • You're migrating gradually — starting with front-end or shared-library consolidation

The 80/20 analysis

Most teams under 20 engineers should stay polyrepo. The monorepo tooling investment dominates the productivity gain at that scale. Most teams above 80 engineers benefit from at least a partial monorepo — the coordination cost crosses the tooling cost around that size.

The mid-band, 20-80 engineers, is where the debate actually happens. Our data suggests the tipping point is less about engineer count and more about cross-cutting change frequency — teams doing 2+ cross-repo refactors per quarter gain meaningfully from a monorepo; teams doing fewer don't.

Common migration pitfalls

  • Migrating without a build cache. Just concatenating repos into one makes CI explode. Bazel, Nx, Turborepo, or Pants are not optional; they're the migration itself.
  • Ignoring CODEOWNERS rigor. Without path-based ownership, monorepo ownership becomes a mud puddle and PR review-routing breaks.
  • Keeping per-service version tags. Monorepo loses most of its benefit if you re-introduce version boundaries internally. Pick: trunk-based with feature flags, or don't migrate.
  • Underestimating IDE pain. IntelliJ can index a 500K-file Java monorepo; it doesn't do it fast. Budget for developer-platform time to maintain custom indexing configs.
  • Not measuring before and after. Without IDE telemetry or equivalent, the claimed productivity gains are self-reported and noisy. Our IDE heartbeat data is the least-biased signal for before/after comparisons.

Summary table

AreaWinner for < 20 engWinner for 20-80 engWinner for 80+ eng
Developer day-to-dayPolyrepo (simpler)Depends on cross-cut freqMonorepo
CoordinationPolyrepoDependsMonorepo
CI / build costPolyrepoDependsMonorepo (with tooling)
Ownership clarityPolyrepoTieTie (with CODEOWNERS)
Cross-cutting refactorPolyrepo painfulMonorepoMonorepo
Infra investment burdenPolyrepoDependsMonorepo (acceptable)
OverallPolyrepoCross-cut frequency decidesMonorepo

The contrarian take

Most migration case studies we read claim monorepo "just works" after 6 months. Our data doesn't agree. Teams that migrate without a committed platform-team investment see productivity regress for 9-15 months, not the 3-6 months promised in conference talks. The monorepo win is real, but it's conditional on tooling maturity and a budget for a small devprod team. If you can't fund that, stay polyrepo and fix coordination with better cross-repo tooling (Shipyard, Bit, Dagger). The tool doesn't fix the organizational problem; the commitment to devprod does.

Where PanDev Metrics fits

We track context switches per developer directly via IDE heartbeat — when a dev switches between repositories, the telemetry captures it as a project-switch event. This lets teams measure the real productivity impact of migration across the cutover. A typical monorepo migration in our dataset: context switches fall within 4-6 weeks, focus time recovers by month 3, and CI frustration (measured via "waiting" time in the IDE) temporarily spikes around the cutover before stabilizing. You can see the curve, not just the destination.

An honest limit

Our data tilts toward teams of 20-150 engineers. We have fewer observations of Google/Meta-scale monorepos, so the "elite monorepo" configuration relies more on published case studies than on our direct measurement. At the other tail, solo-dev or 2-person teams rarely matter for this question — repo strategy doesn't move the needle at that size.

Ready to see your team's real metrics?

30-minute personalized demo. We'll show how PanDev Metrics solves your team's specific challenges.

Book a Demo