Why Microservices are better than Monoliths
Carvia Tech | May 27, 2019 | 2 min read | 50 views
Why Microservices are better than Monoliths?
Microservices architecture is meant for developing large distributed systems that scale with safely. Monolith approach has inherent problems which drags the overall software development process, for example:
The development effort required to build a monolith could be much more because its not easy to divide and scale the development effort. The different components are tightly coupled and parallel development is a tricky job.
A single wrong commit by a developer can break the build, blocking the entire team, because everyone is dependent on single codebase. Potential & scope for such mistakes is reduced in microservices.
Whenever we want to add/update functionality, developers need to change at-least one of these three components and deploy the new version to production. Any single change to production requires a full redeployment of the entire codebase, which brings risk of production downtime.
There are limitations in choosing technology stack. We can not build one components in Go (performance reasons), another in Node.js (high network handling) and few others in Java (simplicity in design).
When we need to scale a monolith, we deploy the same version of monolith on multiple machines, by copying the big war/ear file again and again. Everything is contained into single executable file.
The complexity of a monolith grows rapidly over the time, because its not easy to create bounded context in monoliths. Shared modals becomes too large and complex over time, which no one easily understand.
As illustrated in above example, a typical monolith eShop application is usually a big war file deployed in a single JVM process (tomcat/jboss/websphere, etc). Different components of a monolith communicate with each other using inprocess communication like direct method invocation. One or more databases are shared among different components of a monolith application.
Top articles in this category:
- Cracking Spring Microservices Interviews - question bank
- 50 microservices interview questions for Java developers
- How will you Partition a typical e-shop into Microservices Architecture
- Is it a good practice to deploy multiple microservices in a single tomcat container
- What is Spring Boot and what are its advantages
- Spring Cloud and its advantages
Recommended books for interview preparation:
Find more on this topic:
Microservices Architecture and its implementation using Spring Framework
Last updated 1 week ago