Micro Services Vs Multi-module

I would like to understand which advantages of microservices can be applied in a multi-module project.
I want independent deployability without microservices overhead.Is that possible for multi-module?

You should start by gathering your system’s non-functional requirements. Once those are clear, then it make senses to talk about architectural design.

1 Like

The first thing is to understand what “microservices” actually means. The key characteristic of microservice is that it is independently deployable software module, which has its one development pipeline, integration tests etc. Any new version of microservice should maintain backwards and forwards compatibility in the ecosystem of software depending on it. I.e. deploying a microservice module, should not require you to deploy a new version of an other module depending on it. Otherwise it is not a microservice, but something else. This is a very difficult requirement to meet and requires extensive amount of design and maintenance. Thus most systems that claim to be microservice based are actually not. Microservice architecture adds thus lot of overheads that are not justified in small to moderately large applications.

Microservice architecture is justified typically only in the extremely large applications. Typical applications in scope of Vaadin framework are not such.

Furthermore microservice should own its own data model and should avoid horizontal dependency in other microservices. If your business data model have complicated interdependencies it is not suitable for microservices.

The industry had microservice hype, but is finally gradually understanding that applications that are artificially made microservice based without understanding their non-functional requirements are much better to be implemented as single- or multi-module monoliths. There is even a claim that every application should be developed as monolith first and only by out of necessity if it grows big enough by some metric, it may be converted to microservice based (provided that the business data model does not have those complex interdependencies, which will prevent that to happen in any case). It is the architecture of last resort.

1 Like

It’s in general not possible since a regular multi-module setup communicates between the modules through being run in the same JVM whereas microservices communicate among each other using e.g. HTTP.

The key question is why you want independent deployability, and whether that’s worth turning the application into a distributed system?

There’s been something of an awakening in the whole developer ecosystem in these past few years with realizing that the costs in the form of additional complexity are typically just too high. Sure, if you have some specific part of the application that really begs to be run in a different way then split out that specific part but then still keep the rest as a modular monolith rather than further splitting it up. One big benefit of a properly architected modular monolith is that it’s relatively easy to separate out one of the modules into a separate service later when it’s absolutely certain that it’s needed rather than having all of that extra complexity from the beginning.