Every software organization eventually has to decide where its code lives. One answer is the monorepo, a single version-controlled repository that holds many projects, libraries and services side by side. The other is the polyrepo approach, in which each project, service or library gets a repository of its own and the pieces are stitched together through published packages and versioned interfaces. The choice can look like a matter of housekeeping, but it shapes how teams share code, how changes travel through a system, how builds and tests are run, and even how people think about ownership. This essay argues that neither layout is inherently superior. Each one moves cost from one place to another, and the right decision depends on how tightly a codebase is coupled, how much tooling an organization is prepared to own, and how independently its teams need to move.
Defining the Terms
A monorepo is not the same thing as a monolith. A monolith is a single deployable application; a monorepo is a storage decision. A monorepo can contain dozens of independently deployed services, mobile apps, command-line tools and shared libraries. What unites them is that they share one history, one set of branches and, usually, one top-level build and test system.
A polyrepo arrangement splits that history apart. Each repository has its own commits, its own release cadence and often its own build configuration. Code moves between repositories in the form of versioned artifacts: a library is tagged, published to a package registry, and then consumed by other projects that pin to a particular version.
Both models have long and respectable histories. Google has described in public, including in a 2016 article in Communications of the ACM, how it keeps the large majority of its source code in a single repository. Many other companies, and the vast majority of open source projects, live comfortably with one repository per project. The existence of successful examples on both sides is itself evidence that the question has no universal answer.
The Case for a Single Repository
The strongest argument for a monorepo is atomic change. When a shared library and every one of its consumers live in the same repository, a developer can change the library’s interface and update every caller in a single commit. The change is reviewed as one unit, tested as one unit and, if necessary, reverted as one unit. There is no window in which half the organization is running against the old interface and half against the new one.
Closely related is visibility. In a monorepo, anyone can search the entire codebase to find out who calls a function, how a configuration option is used, or whether someone has already solved the problem at hand. That visibility encourages reuse, discourages quiet duplication, and makes large-scale refactoring practical, because the person making the change can see its full blast radius before committing.
A single repository also tends to produce consistency. One linting configuration, one formatting standard, one set of continuous integration rules and one dependency policy apply everywhere. New engineers learn a single workflow rather than a different one for every project they touch. Third-party dependencies can be held to one version across the codebase, which reduces the familiar problem of two services quietly depending on incompatible releases of the same library.
Finally, monorepos simplify the developer’s mental model of the system. Cloning one repository gives a complete picture. Cross-cutting features, such as a change to a logging format or a security fix in a shared authentication module, can be planned and delivered as a single piece of work rather than as a coordinated campaign across many repositories and many release schedules.
The Costs of a Single Repository
The benefits of a monorepo are real, but they are not free, and most of the costs show up as tooling. Ordinary version control workflows begin to strain as a repository grows. Cloning takes longer, status checks slow down, and naive continuous integration that rebuilds and retests everything on every commit becomes prohibitively expensive. Organizations that run large monorepos successfully generally invest in specialized build systems that understand dependency graphs, such as Bazel, which grew out of Google’s internal tooling, or comparable tools, so that only the code affected by a change is rebuilt and retested. Those systems are powerful but demanding, and someone has to own them.
Atomic change also has a darker side. If anyone can change any caller anywhere, then a single mistaken commit can break many teams at once. Monorepos therefore tend to require strong automated testing, careful code ownership rules and review policies that route changes to the right people. Without those safeguards, the ease of making a sweeping change becomes the ease of making a sweeping error.
Access control is harder as well. Version control systems typically grant permissions at the level of the repository. When everything lives in one place, restricting a sensitive subsystem, or sharing one component with an outside partner, requires additional machinery or awkward workarounds.
There is also a cultural cost. Uniform standards help consistency, but they can frustrate teams whose needs differ from the norm. A team building a small experimental tool may find itself bound by the same build rules, review requirements and dependency versions as the organization’s most critical service. Upgrading a shared dependency can become a negotiation across the whole company, because one version must work for everyone, and the slowest consumer sets the pace.
The Case for Multiple Repositories
The polyrepo model’s central virtue is autonomy. Each team controls its own repository, its own build process, its own release schedule and its own choice of tools. A team can adopt a new language version or test framework without waiting for the rest of the organization. That independence matches the way many organizations are actually structured, and it keeps the cost of a local decision local.
Separate repositories also create clear boundaries. Because consumers depend on published, versioned artifacts rather than on whatever happens to be in a shared tree, the interfaces between components must be explicit. That discipline encourages thoughtful API design and semantic versioning, and it allows a consumer to upgrade on its own schedule rather than being pulled forward by someone else’s commit.
Standard tooling works well at the scale of an individual repository. Ordinary hosting services, ordinary continuous integration and ordinary version control commands perform comfortably without specialized infrastructure. Permissions are straightforward: a repository can be private, shared with a contractor, or published as open source without affecting anything else.
Failures are contained, too. A broken build in one repository does not stop work in another. For organizations whose products genuinely are independent, such as unrelated applications that share little code, a polyrepo layout mirrors reality without forcing artificial unity.
The Costs of Multiple Repositories
The weaknesses of the polyrepo model are the mirror image of the monorepo’s strengths. The most painful is coordinated change. When a widely used library needs an incompatible change, the work spreads across many repositories, many pull requests and many release cycles. The library’s maintainers often have to support old and new versions side by side for a long time, and some consumers may never upgrade at all.
That leads to version drift. Different services end up depending on different releases of the same internal library, and sometimes on different releases of the same third-party dependency. When a security vulnerability is announced in a common component, finding every affected repository and getting each one patched can take considerably longer than making a single change in a shared tree.
Discoverability suffers as well. Code that lives in dozens or hundreds of repositories is harder to search, so engineers are more likely to reinvent utilities that already exist elsewhere. Organization-wide standards, such as a lint rule or a continuous integration requirement, must be copied into each repository and then kept in sync, which in practice means they slowly diverge.
The polyrepo world also has its own tooling burden, even if it is less visible. Organizations frequently build scripts and bots to open bulk pull requests, track dependency versions across repositories, or keep shared configuration aligned. In other words, the coordination cost does not disappear; it moves from the build system into processes and automation that live outside any one repository.
Choosing in Practice
Seen side by side, the two models trade one kind of difficulty for another. A monorepo makes change across boundaries cheap and makes scale expensive. A polyrepo makes independence cheap and makes coordination expensive. The useful question, therefore, is not which layout is better in general, but which costs an organization is better equipped to pay.
Several factors tend to point in a particular direction. When components are tightly coupled and change together frequently, the atomic commits of a monorepo provide real value. When components are loosely coupled, have different owners, or are released to different audiences, separate repositories reflect that independence more honestly. Organizations with the resources to run sophisticated build infrastructure can absorb a monorepo’s scaling costs; smaller teams without that capacity may find the default tools of the polyrepo world easier to live with. Requirements for fine-grained access control, outside collaboration or open source publication generally favor separate repositories.
Hybrid arrangements are common and often sensible. An organization might keep its closely related services and shared libraries in one repository while maintaining separate repositories for open source projects, experimental work or components shared with partners. What matters is that the boundaries follow real differences in coupling and ownership rather than habit.
It is also worth remembering that the decision is not permanent, although reversing it is expensive. Merging repositories requires reconciling histories, build systems and conventions; splitting one apart requires defining the very interfaces that a monorepo allowed teams to leave implicit. Either migration is easier when the reasons for it are clear.
Conclusion
The monorepo debate is sometimes framed as a contest between modern efficiency and old-fashioned fragmentation, or between centralized control and team freedom. Neither framing survives close examination. A single repository offers atomic change, visibility and consistency, but demands serious investment in build systems, testing and ownership rules. Multiple repositories offer autonomy, clear boundaries and simple tooling, but turn every cross-cutting change into a coordination project and allow versions and standards to drift. A careful organization will look at how its code is actually connected, how its teams are actually organized and what infrastructure it can actually maintain, and choose the layout whose costs it is best prepared to carry.
GenM Software Team
