Advanced Topic 42 of 50 DevOps & Tooling
Monorepos
Single repository hosting many projects.
How it works
A monorepo stores many projects, libraries and services in one version-controlled repository, as Google and Meta do at huge scale. Benefits include atomic changes across components, shared tooling and dependency versions, easy code reuse and refactoring and one place to search. Costs include tooling that must scale: build systems such as Bazel, Nx, Turborepo and Pants build only what changed and cache results, and sparse checkout and CODEOWNERS files manage large trees and ownership. This is different from a monolith, which is a single deployed application, and a monorepo can hold many independently deployed services.
Where it is used
Organizations use them to keep a web app, mobile app and shared packages in sync and to roll out an API change together with all its callers.
Common pitfall
Without affected-only builds, CI becomes slow, unclear boundaries let projects entangle and permissions are coarse. Enforce module boundaries, cache aggressively and define clear owners.
Where it fits in the course
Monorepos is topic 42 of 50 in DevOps & Tooling, rated Advanced. It follows Trunk-Based Development. The next topic is Reproducible Builds.
Practice and explore
- Open the interactive lesson, with a mini quiz.
- Take the DevOps & Tooling quiz.
How to study this topic
- Read the explanation above and restate the definition in your own words.
- Open the interactive lesson and answer its mini quiz.
- Read the common pitfall, then write a short example that avoids it.
- Check your understanding in the DevOps & Tooling quiz, and revisit the topic if you miss a question.
Frequently asked questions
What is Monorepos?
Where do people use Monorepos?
What is the most common mistake with Monorepos?
What should I learn before this topic?
How can I practice it?
Is Monorepos hard to learn?
How long does it take to learn Monorepos?
Which topics are related to Monorepos?
What should I study after Monorepos?
Related topics
- Trunk-Based Development (DevOps & Tooling)
- Reproducible Builds (DevOps & Tooling)
- Feature Flags (DevOps & Tooling)
- Linux Performance Tools (DevOps & Tooling)