Development
What is the difference between monorepo and polyrepo?
A monorepo stores all projects and services in a single version-controlled repository. A polyrepo gives each project its own separate repository. Monorepos simplify cross-project changes and dependency management but require specialized tooling (Nx, Turborepo) at scale; polyrepos offer clearer ownership boundaries and simpler CI but make coordinated changes across services harder.
Key Considerations
- Monorepos excel when teams share libraries, APIs, or need atomic cross-project commits
- Polyrepos are simpler to set up and work well when services are truly independent with stable interfaces
- Build performance is the main monorepo scaling challenge — use Turborepo, Nx, or Bazel for incremental builds
- Git performance degrades in very large monorepos — consider shallow clones and sparse checkouts
- Many successful teams use a hybrid: monorepo for tightly coupled services, separate repos for independent products