1 Monorepo vs Polyrepo: Strategies and Trade-offs
A monorepo stores many projects (services, libraries, apps) in a single Git repository; a polyrepo (multi-repo) gives each project its own repository. Neither is universally correct — the choice is about trade-offs.
- Monorepo — atomic cross-project commits, one place to change shared code, unified tooling and CI, easy large-scale refactors. But the repo grows huge, requires scaling tooling, and needs strict ownership controls.
- Polyrepo — small independent repos, clear boundaries, independent release cadence and access control. But cross-cutting changes span many PRs, and dependency/version drift is common.
Companies like Google and Meta run enormous monorepos with custom tooling; many open-source ecosystems remain polyrepo. Pick based on team size, coupling between projects, and the tooling you can invest in.
# A monorepo groups projects under one .git
monorepo/
apps/web/
apps/api/
libs/shared/
.git/ # single history for everything