tldr;
Monolithic services is a software architecture where the entire application is structured as a single unit.
Microservices is a software architecture where the entire application is separated into logical units.
There are quite a few points that should be considered before selecting between the above two architecture.
Points to Remember
Before choosing to go ahead with microservices architecture because it is in trend these days. It is important to look at all the points and then make an informed decision. Let’s dive deeper.
The above diagrams Fig 1.1 shows the interaction flow that usually happens in the monolithic services. As shown in the above diagram the user interacts with the application directly and all the component be it logging and monitoring services or healthcheck component is in the same application itself.
Whereas, the below Fig 1.2 shows the interaction flow in case of a microservices architecture. Here the user will be able to interact with the required part of the application as other services/components will have logical separation and will run as a different application.
Key Trade-Offs
Some of the trade-offs while dealing with architecture decision is shown below:
Monolithic design has no logical separation in the application apart from the folders. Because of this, engineers have to look at the whole codebase even if they are interested in specific aspect of the application. Whereas, in microservices design logical separation makes it easy to skim through the code base.
Monolithic services have tight coupling and microservices don’t. In my recent project where we implemented event-based microservices, whenever we changed once services event schema the other services were affected. But this can be enforced in monolithic design. Changing the schema at one place will enforce you to change it at other places due to tight coupling and thus will reduce the chances of breaking the application.
Monolithic design limits the scalability of the code base. It becomes difficult to manage all the code in the same application and thus it limits scalability. But limited scalability is a relative concept. It limits scalability in comparison with microservices architecture where plug and play is easy.
Testing complexity is a lot higher in monolith design where you have to figure out ways to mock intermediate/3rd party services and test the application. This becomes easy in case of microservices. You can easily mock/ignore third party services and test the rest of the services.
Monolithic architecture can help you save a lot of cost in running the application as compared to microservices. Since all the components in the microservices run as a different application, the cost of it’s compute increases.
Conclusion
While both the architectures have it’s own pros and cons. It becomes really important to do due diligence before deciding which one to go with. Both the architectures has it’s own use cases and advantages. So……. DYOR.
Thanks for Reading
Thanks a lot if you have made it till here. Now just a couple of small requests.
Do connect with me over Linkedin. Message me if you are looking for a tech blog writing collaboration.
Do comment your feedback and views about the topic.