DEV Community

Discussion on: Do you use a monorepo?

Collapse
 
mikenikles profile image
Mike

Hey Patryk,

My personal website uses a monorepo for both the frontend and the backend. The source code is available at github.com/mikenikles/www-mikenikl.... As a follow up, I created a monorepo template at github.com/mikenikles/monorepo-tem....

Each service currently has its own dependencies, so it's not truly a monorepo with shared dependencies across all services. However, I'm writing a book on cloud native web development at the moment and for that, I am updating the monorepo template to include shared dependencies and a CI / CD pipeline that automatically determines which services to build and deploy based on the changes in each git commit.

You can tell, I've had positive experiences with monorepos despite the initial challenges they come with, especially in larger teams. However, with the right attitude, team structures and guidelines in place, I continue to believe the pros outweigh the cons in the monorepo debate.

Do reach out if you have questions.

Collapse
 
deimosfr profile image
Pierre Mavro

Don't you think "the right attitude, team structures and guidelines in place" cost too much for most of the companies?

Only a small amount have the problematic like Google of Facebook and require monorepo. From my POV, I've never really used monorepo, but it looks like there is no really consensus on how to manage it, CI/CD are not adapted to it...it cost a lot of time to handle it.

Correct me if I'm wrong, I'll be also happy to get feedbacks of persons who really are using it and can bring clear advantages.

Collapse
 
mikenikles profile image
Mike

I agree with you, this is a balancing act between cost of maintaining multiple repositories and cost of implementing a monorepo, training the team and putting guidelines in place.

Especially with a lack of best practices and a lack of well documented how-to experiences, this is quite a bit of investment a team or company has to put in.

In my personal experience with monorepos of 15 to 20 engineers who work in it, that initial monorepo setup has been beneficial in the long run. However, I too am interested to hear from others who have hands-on monorepo experience.

Collapse
 
pjeziorowski profile image
Patryk Jeziorowski

Hey Mike,

thanks a lot for your valuable answer. I'll definitely study your template tonight. I wonder what's the way to build a CI/CD pipeline that is suitable for all kind of monorepos, not just JS focused. It seems like monorepos are most popular in JS world with tools like lerna, and even in JS ecosystem you can find various ways to do monorepos (there's no commonly accepted standard).

Collapse
 
mikenikles profile image
Mike

I can't comment on a multi-language monorepo as I don't have experience with that. My main focus is in the JavaScript ecosystem. This definitely makes the monorepo situation much simpler compared to a multi-language monorepo.