In monolithic architecture, the parts of an application operate together, closely integrated/coupled and deployed as one package.
- A large application that have many different components which are packed together as one executable.
- It is slow to build, test and deploy.
- Monolithic, hard to implement changes because code are tightly coupled. of it there are minor changes in one component, there's a great chance that other might get affected.
- The entire application needs to be deployed every time there is an update.
On the other hand, microservices divide the application into a set of independently deployable and scalable services.
Advantage
- Reduce coupling: It is a loosely coupled service that operates as an independent component on a variety of resources.
- interaction between all Major part of the application is happening over an API. A network call is happening and they're interacting with each other.
- Agility: Easier to build, test and deploy, as you focus on each individual component
- Scalability: new component can be easily add without affecting others.
Disadvantage
- harder to keep track of everything from where
- Latency: All communication between components is through network call. So it's an API call happening within the components. So it becomes you might see some sort of latency issue as compared to monolithic.