Monolithic VS Micro-service Architecture

chanduthedev
3 min readSep 27, 2023

--

In this article, I will discuss about Monolithic and Micro-services architectures design paradigms.

  • Monolithic architecture used earlier days of software development
  • Micro-services architecture came into existence due to a single application involving multiple clients like web/mobile, multiple back-end systems
  • No architecture is bad, both Monolithic and Micro-service are good in their own way
  • Carefully select architecture basing on application
  • Amazon prime video monitoring service moved from Micro-services to monolithic architecture to save 90% cost saving.

1. Monolithic Architecture:

  • Monolithic application is a Single large application
  • All the components are integrated with in the application
  • Single code base for whole application
  • This is the traditional development approach

1.1 When to use:

- Monolithic architecture is good for standalone applications like desktop applications
- This approach is good if application/system doesn’t interacting with multiple sub-systems
- Some of the monolithic applications are IDE’s, Text Editors, Media Player’s etc. which doesn’t require any external services after installing in the system

1.2.1 Advantages:

- Easy to maintain the code base
- Easy to deploy as only one code base
- Easy to monitor

1.2.2. Disadvantages:

- As the application grows, maintaining, deploying and monitor will be difficult
- Any little change in one component need to test and deploy whole application
- Updating a single component needs whole application deployment
- Upgrading is a problem(need to migrate whole application at once which difficult task)

2. Micro-services Architecture:

  • Independent components/services
  • It has to be moduler
  • Communication between services using standard interface RESTful
  • Loosely coupled between services
  • Each service has its own DB
  • Each service implemented with its own tech-stack
  • Multi-Dev platform (Polyglot) as one service can be implemented using (Java, spring boot) and another service can be implemented using (Python, flask)
  • Each service handled by one team(all components UI, API, DB)
  • This approach relies on the concept of You Build It, You Deploy It and You Support It
  • Automated testing and deployment
  • Logging and monitoring should be in place
  • Code must fail and it should fail fast

2.1 When To Use:

  • Micro-services architecture should be used when application involves multiple sub-systems
  • Now a days most of the mobile applications are Micro-services architecture to their sub-systems involvement
  • Most of the banking applications are Micro-services application because of sub-systems (Credit Cards, Loans, Insurance etc)
  • Super Apps like Paytm, WeChat, Gojek are micro-services applications
  • Streaming apps like Netflix is a micro-services application

2.2.1 Advantages:

  • Application always available(24x7), no downtime
  • if One service is down, still application will run and only that service will not be available
  • If some changes made in one service, only that service will be deployed
  • Upgrading to new version or migration is easy
  • Multiple technologies can be used depending on the service (Java may be good for Thread based service and NodeJS may be good event based services and Python may be good for ML based service)
  • Communication with in the service team is very easy as UI/API/DB members are with in a team
  • Multiple code base

2.2.2 Dis-Advantages:

  • Need to be careful when choosing micro-services
  • If not selected carefully, it will impact performance, cost etc. refer Amazon prime video monitoring service
  • If more services involved, there is a chance of delay/network issues
  • Logging and monitoring will be difficult
  • Orchestrating could be an issue when scaling up/down

These days everyone talking about micro-services architecture doesn’t mean that you need to use for every application. Monolithic and Micro-services architectures are design paradigms, need to select basing on application requirement. You can select one paradigm initially and later migrate to another paradigm as well, but it involves extra effort.

--

--

No responses yet