The article was originally published on blog.torque.cloud on Mar 28, 2022.
A few years ago, I stumbled on a research paper, "Why Google stores billions of lines of code in a single repository". As it turns out, Google has been successfully using monorepo for years and gained a lot from that codebase approach. And Google is not the only big player using it. Allegedly Microsoft, Uber, Airbnb, Twitter, and many others have taken this path.
Wikipedia defines monorepos as "a software development strategy where code for many projects is stored in the same repository." There are many benefits to using monorepos. To name a few:
No overhead to create new projects
Atomic commits across projects
One version of everything
A consistent way of building and testing applications written using different tools and technologies
Working with monorepos takes far more than throwing all your projects in one repository and calling it a day. It requires a lot of manual work just to keep the multi-project environment in sync:
Writing and running Docker images and docker-compose
Writing and running build scripts
Setting up atomic deployment
Writing Infrastructure as Code scripts (Kubernetes, Terraform, and similar)
Setting up dependency variables, like URLs, passwords, and secret keys
Setting up message queues, background workers, databases, and other services
It doesn't matter how good is your team, this amount of work requires a lot of resources, and it's a risky route to take. That's why setting up and managing a monorepo is resource-intensive and can be challenging.
I know you might be thinking: BIG tech has adopted this approach because they have resources, but what about the others? How can a small startup benefit from it? Or companies scaling operations? How can an enterprise-grade solution migrate to monorepos?
Well, it looks like time is right for monorepos! In recent years tools have emerged that make developing with monorepos very accessible. The momentum is getting stronger by the day. Developers can quickly get a hands-on experience with monorepos and get a taste of the possibilities.
I won't dwell on all monorepo details, nor will I discuss current tools that are on the market. Others have done an excellent job covering all those topics. I suggest looking at https://monorepo.tools for further study.
Now, what about Torque? Well, Torque's workspace is a monorepo. Torque handles monorepo functionality using code automation packages from the public registry. Developers install and configure packages inside their monorepo to deliver any kind of architectural components like frontends, backends, databases, caches, queues, search indexes, background workers, API integrations, and much more. Unlike other monorepo tools like Nx, Turborepo, or Lerna, Torque gives you the whole experience, from coding, testing, and running on laptops to building and deploying to any cloud.
Thanks for reading! Follow us for more cloud related topics.