1.

Why Microservices are better than Monoliths?

Answer»

Microservices architecture is meant for developing large distributed systems that scale with safely. There are many benefits of microservices architecture over monoliths, for example:

  1. Monolith application is built as a single unit, it is usually composed of 3 components – a database (usually a RDBMS), a server-side executable (war file deployed in tomcat, websphere etc) and a client interface (JSP, etc.)
  2. 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. The entire system is TIGHTLY coupled, have limitations in choosing technology stack, have low cohesion. 
  3. When we need to scale a monolith, we deploy the same version of the monolith on multiple machines, by copying the big war/ear file again and again. Everything is contained into a single executable file.
  4. Microservices Architecture, on the other hand, is composed of small autonomous services, divided over business capabilities that communicate with each other over network mostly in async fashion. 

As illustrated in the 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 in-process communication LIKE direct method invocation. One or more DATABASES are shared among different components of a monolith application.



Discussion

No Comment Found