We are migrating from a monolith to microservice.
Note : We store the tenant details in master tenant db which is seperate from the application database
The app serves multiple tenants and has around 10 sub modules which are tightly bound.
We are splitting the 10 sub modules into 10 different services and planning to use single database for all the sub modules.
There are around 20 tables in a single database without references.
- Keep the connection establishment , model , DTO , response classes (all common classes for all modules are placed in a base class)
- Add the base class as a dependency module for all the other 10 sub-modules.
I have the following question for which I couldn't get any proper responses while surfing the internet.
1) Is the above `Plan to` a valid approach ? 2) Will each sub-module try to make its own connection ? 3) How to address the issue of base class becoming huge and is duplicated in all sub-modules ? 4) Will this cause any deadlocks since each service will connect to same db at any given time ?
Thanks in advance.