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
Please enter at least three characters to search
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

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

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

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

  • The Pros and Cons of API-Led Connectivity
  • Build a Stateless Microservice With GitHub Copilot in VSCode
  • From Prompt to Running Microservice: ServiceBricks Step-By-Step
  • Dropwizard vs. Micronaut: Unpacking the Best Framework for Microservices

Trending

  • Solid Testing Strategies for Salesforce Releases
  • Docker Model Runner: Streamlining AI Deployment for Developers
  • Unlocking AI Coding Assistants Part 2: Generating Code
  • My LLM Journey as a Software Engineer Exploring a New Domain
  1. DZone
  2. Data Engineering
  3. Data
  4. Microservices: Pros and Cons of Mono Repos

Microservices: Pros and Cons of Mono Repos

When putting a system together, you need to decide whether you're going to keep the code in one repository or split it across multiple repos. Here's some insight.

By 
Deepak Karanth user avatar
Deepak Karanth
·
Jul. 29, 16 · Opinion
Likes (12)
Comment
Save
Tweet
Share
10.9K Views

Join the DZone community and get the full member experience.

Join For Free

Recently, there was an interesting question on Quora on microservices — what companies use a mono repo but deploy as microservices?

The real question is hidden behind those words. Is it OK to use mono repos to store microservices code?

Microservices-monorepo


At first glance, it appears that microservices and mono repos are at odds with each other. Does it make sense to have microservices code in a mono repo when they are going to be deployed independently of each other?

Do any companies use this style of operation?

Yes, they do!

  1. Facebook has a mono repo, as seen in this post – Scaling Mercurial at Facebook.
  2. Google is rumoured to have mono repo (as indicated by many posts), but I can't be sure as I haven't worked there.
  3. Shippable, on their blog, mentioned that they have a mono repo. In fact, they moved from multiple repositories to a mono repo.

The most important result of using microservices architecture should be that each of the services must be fully autonomous — they must not have any design time dependencies.

All other considerations vary from company to company. Some such considerations are:

  1. The meaning of "application:" A statement made by Martin Fowler captures the essence of microservices perfectly — "In short, the microservice architectural style is an approach to developing a single application as a suite of small services." The key words being "single application." At the end of the day, all the microservices are contributing to form a single application. For some people, it makes more sense to have all the source code in one place because an individual service on its own might have no meaning.
  2. Code style: Some companies find it useful to have a consistent coding format enforced across all their code. This is certainly more difficult to achieve when you have separated repositories. This is especially true of companies that are dependent on manual verification of code as against automated code quality checks.
  3. Testing: It is easier to create integration tests when you have all the services in one repository because the creation of testing environment and deployment become easier.

Note that having a single repository comes with a number of drawbacks.

  1. CI and CD pipelines: Ideally, you would want your CI and CD pipelines for each microservice to be independent of each other. You would not want the entire build to fail if one of the services is having errors.
  2. Code dependencies: It's difficult to avoid compile time dependencies. You would need a process or a person to make sure that no one is building services that are dependent on each other. At the same time, remember that mono repo does not mean tightly coupled code.
  3. Team dependencies: Following on from the above point, teams that share a single repository do not have complete freedom to make changes in the code as there are dependencies on other service's code.

So, in summary, certain organization factors do exist that force having microservices code in a mono repo. It is perfectly fine as long as proper guidelines exist to manage dependencies and ownership between code owned by different teams.

microservice Mono (software) Cons

Published at DZone with permission of Deepak Karanth, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • The Pros and Cons of API-Led Connectivity
  • Build a Stateless Microservice With GitHub Copilot in VSCode
  • From Prompt to Running Microservice: ServiceBricks Step-By-Step
  • Dropwizard vs. Micronaut: Unpacking the Best Framework for Microservices

Partner Resources

×

Comments
Oops! Something Went Wrong

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:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!