The better approach of repository structure for microservice architecture based applications?
For example, I was referring through Microsoft reference architecture i.e. eShopContainers in github repository [https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/src]. But that comes up with some more complexity of dynamic work environment, where team work on various UI, microservices, hence everything under one repository is making it more time consuming process on merge/conflicts, etc. Some team members would like to have each microservice in separate repository while development for better management and then to export to group repository after production i.e. while BAU. Appreciate to have a discussion the pros and cons to make a better decision for our environment.
One of main benefits of using microservice architecture is ability to introduce new technologies without performing full rewrite. It's easy to think only about programming languages and frameworks - but the truth is that version control software is exactly the same. I've seen teams migrating from SVN to Git, or TFS. It's naive to believe that Git will stay with us forever. I believe this is a strong argument for using multiple repositories.
Single repository - as long as it has advantages - will always tempt developers to make some kind of cross-project dependencies. Maybe it will be one build file in specific build tool used to compile all the microservices. It may be a common library directory with specific versions of external dlls or jars or anything. There always will be a tendency to create such a thing. Which will finally make these microservices somehow bound and dependent.
I believe that good way to store the project(s) created using microservice architecture in multiple, independent repositories.
Having done both, here are some of the tradeoffs:
For a monorepo (all code and services in the same repo):
Multiple repositories:
There are no doubt others, but these are some that I've actually experienced in both cases. A monorepo is probably better if you're going to be evolving a lot of services in parallel; multiple repos is better if you can architect your services pretty much independent of each other.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With