DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workkloads.

Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • Guide To Setting up a Node.js Monorepo With Lerna
  • Source Code Management for GitOps and CI/CD

Trending

  • A Guide to Container Runtimes
  • Solid Testing Strategies for Salesforce Releases
  • Docker Model Runner: Streamlining AI Deployment for Developers
  • Unlocking AI Coding Assistants Part 2: Generating Code
  1. DZone
  2. Software Design and Architecture
  3. Microservices
  4. Dangers of Monorepo Projects

Dangers of Monorepo Projects

A monorepo is a single organization-wide source code repository. Google famously uses one. If you are thinking of using one, there are things you should think about first.

By 
Matt Farina user avatar
Matt Farina
·
Jan. 19, 16 · Opinion
Likes (2)
Comment
Save
Tweet
Share
8.3K Views

Join the DZone community and get the full member experience.

Join For Free

I've noticed an increase in the number of projects using monorepos. Unfortunately, I see a lack of discussion on the dangers of them or how to deal with those dangers. Few jump out of a plane without a parachute or even training and guidance to go along with the parachute. But, when it comes to monorepos we all too often do the software equivalent.

In the Go community this is more prevalent than in some others. I think that comes from the influence of Google who uses monorepos for their proprietary code. Google has had many years to learn how to use them well (hopefully). Not everyone has the benefit of that.

It's worth noting that I'm not telling anyone whether they should leverage monorepos or not. I've done them numerous times. Though, these days I tend to use them far less. These are the things I wish I'd known before using them. Just don't want folks to walk in blind.

Loss of Version Information

So, you're vendoring the dependencies you use. When your application is built and runs tests you don't have to spend time pulling down external packages. That's great.

What versions are the dependencies you're using? Maybe you have the commit ids for the packages you use. Say you're using a package version 1.2.3 but all you have is a commit id as a hash and there's a security issue. They say versions prior to 1.3.0 are vulnerable but not after. You have just a commit id. How do you know if you're vulnerable and should update?

I've seen a number of monorepos where the details of imported libraries are lost. Without those details it can be hard to deal with updates around things like security issues.

Forking Packages

Those vendored libraries, stored in your VCS, are an opportune target. You've got a change, that would be so nice to have, it's tempting to just change it in your vendored copy. Now you have what you want.

Sometime later someone else comes along and updates the version of that vendored library. That change is gone. How long until someone detects it? Now what?

Don't think this will happen to you? I've seen it. More than once. Even with a documented process and patch files stored to re-apply after updates.

SDK to API Mapping

One of the common themes I've been seeing lately is the SDK, REST library, or language binding is in the same repo as the application it talks to.

For the developers who are common between both this can be incredibly useful. But, there are still a couple of potential downfalls.

  1. When the SDK, Rest Library, or language binding is tightly coupled to the exact same API version being served up by the server you have a problem. The API should be versioned and communications happen based on the version rather than any implementation.
  2. Developers who consume the SDK, REST library, or language binding who don't want the server. There are a lot of them. To download the server may be an annoyance. Something I've heard numerous times in "parking lot conversations".

Build And Test Bloat

Ever seen a build and test run take a long time? I'm talking an hour or longer. I'm aware of multiple monorepos where this is the case.

When you have a monorepo broken up into libraries each can be independently and individually tested where there are changes to them. When you have a monorepo it can pragmatically be more difficult. Folks will often built and test in one big shot. Now, apply those large test runs to every push. The CI/CD process can become painful.

Conclusion

Know what you're getting into with monorepos. These are just a few of the issues I've encountered. There are more. Monorepos aren't a silver bullet. If you do them I recommend being active and intentional about avoiding the pitfalls. Otherwise you could end up needing to untangle problems later.

Monorepo

Published at DZone with permission of Matt Farina, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Guide To Setting up a Node.js Monorepo With Lerna
  • Source Code Management for GitOps and CI/CD

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: