FYI logo

Why does Google use Monorepo?

That day when I entered the company, I was really surprised to see that everyone here was setting up a coding environment using the Monorepo concept for all projects and products. For those who don't know, let's learn a little about what Monorepo is!

By Nguyen DuyPublished 2 months ago 3 min read
Why does Google use Monorepo?
Photo by Arthur Osipyan on Unsplash

That day when I entered the company, I was really surprised to see that everyone here was setting up a coding environment using the Monorepo concept for all projects and products. For those who don't know, let's learn a little about what Monorepo is!

According to the textbook: Monorepo (also known as Mono-repo) is a software development strategy in which the source code for all related projects is stored in the same version control repository ( e.g. Git). It contrasts with the traditional method of storing each project in a separate repository. In other words, all projects in the company have only one repository, which means that when you clone git, you can see all the other projects running in the company.

It sounds like something, right? The first thing I'm concerned about is security when everyone can see the code in all projects. In addition, this method is also very difficult to manage. Yes. Why have a concept without knowing clearly what the benefits are and immediately seeing such risks? However, with the view that: If something is reasonable, it will exist, and if it exists, it must be reasonable. So I tried to survey to see what was so interesting about it that the company chose this concept. When I did the survey, I realized that it turns out that big companies like Google and Facebook also use this concept

So why does Google also use Monorepo, what strengths does it have that are worth the trade-off? Basically it has the following advantages:

1. Easily share code:

Gogle has many related projects that need to share common code. Monorepo makes it easier to share this code, which reduces duplication and improves maintainability. For example, code for common libraries can be used by many different projects without need to copy code into each project.

2. Increase overview capabilities:

Managing all of the code in one repository gives Google an overview of the entire system, making it easier to track progress and detect bugs. For example, Google can use analytics tools. analysis to identify unused code sections or code sections that could be improved.

3. Increase efficiency:

Monorepo can help Google increase the efficiency of its software development process by easing context switches and automating tasks. For example, Google can use tools to automate code testing, build Project development and implementation of changes.

4. Quality improvement:

Monorepo can help Google improve software quality by making it easier to detect and fix errors. For example, Google can use tools to automatically detect potential errors in code.

5. Support for rapid development:

Monorepo can help Google develop software faster by making collaboration between development teams easier. For example, different development teams can work on the same code in the repository without need to worry about code conflicts.

However, it must be said again and again, these are the fatal weaknesses of this concept:

- Complexity: Managing one large repository can be more complicated than managing many small repositories.

- Performance: Performing tasks on large repositories can affect performance.

- Security risk: A security vulnerability in the repository can affect all projects stored in it.

And to address these disadvantages, Google has developed a number of tools and processes to manage Monorepo effectively. As if:

- Repo: Repo is an open source tool that helps manage Google's Monorepo repository. Repo makes performing tasks on the repository more efficient.

- Piper: Piper is a system that automates Google's software development process.

- Blaze: Blaze is a software building system from Google. Blaze helps build software projects quickly and efficiently.

So in conclusion, instead of wondering why the company is using this concept and then denying using it, my mindset would be that since it's being used, it means it's reasonable, and when I look into it, I find it. It's also reasonable :D

Basically, this is a very good concept and has many advantages. However, before applying this concept, we must think carefully about its risk level and have an appropriate prevention plan. Just because the big guys do it doesn't mean we should just apply it by default, that's half dead.

Hopefully, the keyword I shared is useful for you. Thank you, I'm Nguyen Duy!

MysteryScience

About the Creator

Enjoyed the story?
Support the Creator.

Subscribe for free to receive all their stories in your feed. You could also pledge your support or give them a one-off tip, letting them know you appreciate their work.

Subscribe For Free

Reader insights

Be the first to share your insights about this piece.

How does it work?

Add your insights

Comments

There are no comments for this story

Be the first to respond and start the conversation.

    NDWritten by Nguyen Duy

    Find us on social media

    Miscellaneous links

    • Explore
    • Contact
    • Privacy Policy
    • Terms of Use
    • Support

    © 2024 Creatd, Inc. All Rights Reserved.