Wednesday, November 15, 2017

Monolithic architecture vs Microservices architecture

If you need to create an enterprise application according to your needs, first of all you should think about the architecture which your application depends. Mainly there are two approaches to begin.



  1. Monolithic architecture
  2. Micro services architecture

Monolithic architecture

  • It is just like a laptop. All things are packed as a single unit.
  • Monolithic architecture means, it makes your application as a single unit. 
  • It looks just create a single jar or war.
  • This is the easiest way to create an application. 
  • If the process goes with waterfall model, this can be the best choice.
  • But if you have a heavy project, application code base will be huge.
  • Still if you want to go with it, you should have a proper coding standards with comments. Otherwise it won't be easy to for future developments. 

Advantages of Monolithic architecture
  • Easy to develop
  • Easy to deploy
Disadvantages of Monolithic architecture
  • Not easy to expand services (Continuous development is difficult).
  • It is really hard to go with Agile method.
  • Huge code base. It is really hard to understand for new developers in future.
  • In this architecture all of the services are connected to one single database. So it will make huge server load.
  • Sometimes it will take a long time to start the web application because of the overloaded web container. 

Microservice architecture


  • It is just like a desktop computer. Several units work together. 
  • I described about Microservices in my previous post. 
  • Microservice architecture makes your application as a set of loosely coupled services.
  • There are a small set of services connecting each other as a one application. 
  • Simply it is not a one single project which is connected to one single database.


Advantages of Microservices
  • It is easy to handle errors. Because services are independent.
  • Easy understanding curve for developers for future developments.
  • Each services can be developed independently.
  • One of the best option for Agile development.
  • Application starts fast and runs smoothly.

Disadvantages of Microservices

  • Creating a microservice based application is really complex.
  • Testing is more difficult.
  • It should have a better communication between developers. Because several services will hit only one front end.
When to use Microservices ?

This is totally depend on the organizational requirements. Microservices produce a pack of services and enables fast delivery with easy testable units. If your company needs to go faster than ever, it may be a reason to change system with microservices. 

Other reason is, if your system is still growing with adding new functionalities, it is better to use microservices. Because microservices are small components of services, You can add new components according to your requirements.