Reputation: 13
I have a very big module ( >100K line ) that I want to break into a few modules to interact with other modules with Rest API. I know I have to break it over some meaningful modules. but however, they have shared data and I do not know what to do with these shared data? Should I duplicate shared entities? Should I use "view"s for shared entities? Should I use just id instead of foreign keys and call Rest API for each usage of shared data? or anything else?
Thank you
Upvotes: 0
Views: 70
Reputation: 3455
This is very, very hard question to answer, almost impossible. And there are multiple answers. Breaking monolith into smaller services is a topic of many books, tutorials, YT videos. It is almost a science. Actually, it is one of the starting points when learning about microservices or refactoring legacy system. So instead of asking should I do this or should I do that, go and read about the topic online. There is a huge number of resources.
Upvotes: 1