TLDR; I'm architecting an hybrid multi-tenant app that needs to handle customizations request from customers (tenants), I'm trying to decide between modular monolith and microservices pattern, Which is the best way to handle customization reducing development costs? How should we handle customizations, I mean, How can I now that the size of the module/microservice is the right size?
NOTE:
If the question need clarification or it's confusing please ask in the comments, I will be eager to clarify anything.
If you need more info please let me know, I'm willing to provide it, please try to be gentle this is so confusing for me.
Sorry for this large post but I think this info is relevant to take a decision I highly recommend to read the whole post, this contains the context and research I made about this topic:
CONTEXT
I'm architecting an hybrid multi-tenant app, It must handle customizations, for example: I have a basic (default) coupons functionality, but one customer (tenant) needs to add some particular logic inside coupons functionality.
You can read more about multi-tenancy here: https://docs.microsoft.com/en-us/azure/azure-sql/database/saas-tenancy-app-design-patterns
Things to consider:
We are going to deal with customers asking for minimal changes, we counted ~ 120 custom requests we are going to work after launching
We expect to have ~1000 tenants on the first month after launching (they are already pre-registered).
After launching, we can't interrupt the operations of the customers that only want the default app features every time we need to implement some custom feature.
RESEARCH
I'm doing some research about architecture patterns, I found 2 main interesting patterns that I consider resolve my problem:
Microservices Pattern
Here are the characteristics of Microservice Architecture: The whole application is split into separate processes where each process can contain multiple modules.
- Contrary to Modular Monoliths or SOA, a Microservice application is split vertically (according to functionality or domains)
- The Microservice boundary is external. As a result, Microservices communicates with each other via network calls.
- Instead of one single database, each Microservice has its database.
- Extra data synchronization is needed due to “database per Microservice”.
Modular Monolith Pattern
Here are the characteristics of Modular Monolithic Architecture:
- The complete Software System is deployed as a whole (all or Nothing)
- The Modular boundary is internal and can be crossed easily which can lead to Spaghetti Code (as shown above by yellow lines)
- The application runs as one single process
- It is one size for all, i.e., one solution for all sizes of application No strict data ownership among modules
What I understand
What I understand so far is:
Each microservice is an app hosted separately and interacts with other microservices using network calls, so I would need to manage multiple servers (kubernetes or docker swarm) and the interactions between microservices(RabbitMQ).
Modular monolith is a single app with modules inside of it, its easier to develop since you don't need to manage different servers and the interactions between modules are simpler, but its harder to handle customization since I will need to recompile and it may cause downtimes to other tenants.
if I choose microservice pattern I would need to invest in a devops team to manage servers and microservices interactions but it's going to be more scalable
if I choose Modular monolith pattern I would need to invest more on each customization.
QUESTIONS
- Which pattern should we use to handle customization reducing development costs?
- How should we handle customizations?, I mean, How can I now that the size of the module/microservice is the right size?
- Which tech stack would you recommend for microservices development and interaction?
EDIT
Customization Example
One real example of what we mean by customization is the following:
The basic app has a Store Functionality it calculates total with price per unit, One customer (tenant) that owns a grocery store doesn't calculate price per unit but he calculates price per kilo after (x) kilos, he asked to us to change the pricing system for his store.


