Development Terms to Know: Monorepo | Acro Commerce
Lindsay Harrison

Author

Lindsay Harrison

, Acro Commerce Alumni

Posted in Software & Development

November 27, 2023

DEVELOPMENT TERMS TO KNOW

What is a Monorepo?

Should You Love Them or Hate Them?

Lindsay Harrison, Project Manager here at Acro, gets to the heart of a term you will hear now and again if you are part of a development team. Monorepos are loved and hated. Read what Lindsay has to say, and you decide how you feel about them.

Definition of Monorepo

A monorepo, short for "monolithic repository," is a software development approach where all the source code for a project or organization is stored in a single version control repository, such as Git, rather than being divided into multiple smaller repositories. In a monorepo, code for different components, libraries, or projects is organized and managed together in one place.

The choice of whether to love or hate monorepos depends on various factors, including the size and complexity of your project, your team's development workflow, and your specific use case. Here are some arguments for both sides and a specific example of how this monorepo approach worked for one of our longtime enterprise clients:

Reasons to Love Monorepos

  1. Code Sharing — Monorepos make sharing code and libraries easier across different parts of your project. This can promote efficiency with code reuse and consistency.
  2. Easier Refactoring — When code is all in one repository, it's easier to make large-scale refactors or changes that affect multiple components.
  3. Simplified Dependency Management — Managing dependencies becomes more straightforward as all dependencies are stored in one place.
  4. Unified Tooling — You can have a unified development, testing, and CI/CD pipeline across the entire codebase, which can lead to consistency and efficiency.
  5. Better Collaboration — Team members can more easily collaborate on different parts of the project since they have access to the entire codebase.

For one of our significant enterprise endeavours, TELUS Business Solutions, we made a strategic decision to transition to a monorepo architecture. This choice was driven by the project's intricate web of closely interconnected applications. Our Project Lead and Senior Software Developer, Cody Banman, recognized that the advantages of this architectural shift would far outweigh the effort involved.

The adoption of a monorepo architecture has empowered us to streamline our development processes, especially when tackling tasks that necessitate modifications across multiple applications within this expansive project.

Reasons to Be Cautious or Dislike Monorepos

  1. Complexity — Monorepos can become complex and challenging to manage as the codebase grows. This can lead to longer build times and increased maintenance overhead.
  2. Tooling Challenges — Some development tools and services are not designed to work with monorepos, so you may need to invest in custom tooling or find workarounds.
  3. Versioning and Release Challenges — Managing versioning and releases for individual components or projects within a monorepo can be more challenging than in separate repositories.
  4. Slower Git Operations — As the repository size increases, Git operations like cloning and branching can become slower.
  5. Team Coordination — In a monorepo, teams may need to coordinate more closely to avoid conflicts and ensure changes don't inadvertently affect other parts of the codebase.

Do You Need a Monorepo?

Development Terms to Know: Monorepo | Acro Commerce

Ultimately, whether you should love or hate monorepos depends on your specific circumstances. For smaller projects or organizations, monorepos may offer advantages in terms of code sharing and simplicity. However, for larger, more complex projects, the challenges of managing a monorepo may outweigh the benefits, and a multi-repo approach may be more suitable.

Evaluating your project's needs, team dynamics, and available tooling is essential to determine whether a monorepo is the right choice for your development workflow. In practice, many organizations adopt a hybrid approach, using monorepos for some parts of their codebase and separate repositories for others to strike a balance between code organization and manageability.

So, that’s the long of it. The short of it is to approach monorepos with caution and consult expert advice when required. 


Have a question? Reach out to our development team for a chat.

Fill in the form below, and one of our subject matter experts will be happy to give you a call.