How to decide between microservices and a monolith


"Should we build a monolith or use microservices?"

This is probably one of the first question every new software development team asks itself.

The answer will almost always turn out wrong, because the team won't know what they'll need until the software is operational in production.

I recommend to adopt a development process that allows to postpone this decission and stay flexible!

Package capabilities, compose services

Package capabilities then compose

Instead of starting to build a specific app or api, structure the code base around autonomous business capabilities.

Include any api endpoints and/or UI components that facilitate the capability in this code base.

Then package those capabilities individually, e.g. into a nuget and / or npm package.

Now create another code base for the hosting code, usually not much more than a program or UI shell entry point, which in turn takes a dependency on the capability packages and calls the configuration entry point of the capability.

Finally build the collective into a modular monolith or autonomous micro service depending on the current needs.

Should your team use a mono-repo or a multi-repo?

I always recommend multi-repo. Even when building a monolith.

Put each capability in its own repo to make it as hard as you can to take lateral dependencies between them.

Yes, I know it will cause some hurt.

But it is a good hurt... like a workout, the team will benefit from it in the long term.

About the author


I love to build web and cloud apps and have been doing so for the past 20 years.

My main areas of expertise are progressive web applications, event driven architecture, domain driven design, event sourcing, messaging, and Microsoft Azure.

Through this blog I hope to share some of this experience with you.

Get in touch

Liked this content? Sign up to my newsletter and never miss any.

You can unsubscribe at any time by clicking the link in the footer of your emails. I use Mailchimp as my marketing platform. By clicking subscribe, you acknowledge that your information will be transferred to Mailchimp for processing. Learn more about Mailchimp's privacy practices here.