Ending Monorepo Vs Polyrepo Debate

Monorepo-vs-polyrepo

Monorepo vs polyrepo is increasingly becoming an ongoing debate among frontend teams. In this article, we take you through the pros and cons of both these approaches. You'll get to know about the use cases suitable for each of these approaches and have a better idea as to which one you should employ.

Component-driven development and micro frontend architecture are the two most sought after ways to build scalable frontend during web app development. The crux behind both these approaches is to break down the frontend into smaller entities. One method enables you to achieve this through smaller components while the other has the provision for building micro frontends.

While both these approaches offer a great deal of flexibility and scalability to your frontend, they also leave you with a lot more moving parts compared to what you’d have on a conventional frontend monolith. With a lot more on the plate, companies start feeling the need of a system that offers them better visibility over the disparate components, makes it easier to manage dependencies, and facilitates product reusability at the same time.

What Is Monorepo?

Monorepo refers to a single repository from which multiple packages are published. These packages remain isolated, and therefore, can be independently upgraded while adhering to all the dependencies.

People often make the mistake of comparing a monrepo with a monolith. But monorepo is a code repository while monoliths are usually massive codebases. Monoliths can be used for monoliths, micro frontends and microservices alike.

Advantages Of Monorepo

Monorepo packs in a ton of advantages for those looking to scale their digital product quickly. Let’s have a quick look at some of them.

  • Visibility
  • Dependency management
  • Consistency
  • Easier refactoring
  • Improved reusability

Monorepo Use Cases For Frontend

Given the benefits of monorepo, and the need to scale quickly in the current digital landscape, a lot of companies use monorepo for their frontend. Let’s have a look at such examples and understand how organizations are benefiting from this strategy.

Zocdoc leveraged atomic commits for speed

Zocdoc is a leading online platform that books medical appointments and connects patients with doctors worldwide. From their humble beginning as a service to locate dentists in Manhattan to operating in 2,000 cities with over 5 million monthly appointments, their growth has been exceptional.

Easier product development for ABC Life

Going by Zocdoc’s experience, monorepo sounds like a must-have for any enterprise relying on a shared component library for product development. ABC Life is another big player who adopted monorepo in conjunction with a component library.

Smoother migration for HMH

HMH is a popular publisher of a variety of work from various genres such as fictional, educational, and non-fictional. Their educational platform, Ed, has millions of users worldwide. To cater to this large a user base, they had to undertake a few scaling projects.

Disadvantages Of Monorepo

So far we discussed all the benefits that monorepo brings along with it. But as we mentioned earlier, it doesn’t fit the bill for all. Here’s where it doesn’t shine bright:

  • Can’t restrict access
  • Steep learning curve
  • Not suitable for for Git

Polyrepo To The Rescue

Multirepo or polyrepo is the usual state of repositories when you work on various components independently. One clear benefit of such an arrangement is the decoupled nature and version-controlled repository for each project.
Outbrain’s Switch From Monorepo To Multirepo To Hybrid-repo

Outbrain is a leading web advertising platform that displays those small boxes containing links on webpages. And they had their fair share of experiences when it came to deciding upon the codebase repositories for the product.

The Wrap-up

The key takeaway here is that you can’t blindly follow any approach. You’ll have to sit down and weigh-in all your options against the goals you have.

Check out the original article to read more about Ending Monorepo Vs Polyrepo Debate.

Coin Marketplace

STEEM 0.17
TRX 0.13
JST 0.027
BTC 60600.18
ETH 2606.88
USDT 1.00
SBD 2.62