Understanding Monolithic Vs Microservice Architecture
At the time of developing sever-side application first question comes in mind about architecture of software.
What is an architecture?
Software architecture is fundamental structure for application and a way of design your system.
is a set up used for traditional server side system function which is based on a single application. Monolithic architecture is tightly coupled system.
Advantages of Monolithic Architecture:
In the early stage of software development monolithic architecture works well.
- It is faster to develop.
- All things wrap together in same code base so co-ordination between different functionalities get easier.
- Easy to deploy. Just need to copy of application to the server.
- Easy to test.
Disadvantages of Monolithic Architecture:
- This is a simple approach for software development. It has it’s limitations in size and complexity.
- At the end of development application become so large and complex to understand and make some new changes.
- Size of application may slow down start-up time.
- Continuous development is difficult to manage.
- Monolithic application has it’s own limitations while adapting new technologies as we have to continue with specific programming languages from start to end.
is the architecture where every feature is it’s own application. The idea is to split your application into a set of smaller, interconnected services instead of building a single monolithic application and communicating with lightweight mechanisms, often an HTTP resource API. The apps don’t have direct access to the back-end services. This communication is carried out with help of API gateway. The API Gateway is responsible for tasks such as load balancing, caching, access control, API metering, and monitoring. It is difficult to find centralized control among these microservices as they are written in different programming languages. And use different data storage technologies. However, having a database schema per service is essential if you want to benefit from microservices, because it ensures loose coupling.
These API carries data in form of JSON.
Advantages of Microservices:
- Large application remains unaffected by failure of any one microservice.
- It gives you more flexibility to add new feature in application as it is totally independent of others.
- Ease to understand as each functionality divided separately.
- These microservices in application has smaller code base so its ease to deploy and ease for continuous integration.
- Easily scale as it’s separate than other services, can scale without affecting other services.
Disadvantages of Microservices:
- As every services are independent, communication among them is painful.
- Handling multiple database resources can be really painful.
- Co-ordination among services really important which makes deployment hard.
- Testing of microservice is harder than monolithic as it need to test all other communicating services.
- Microservices is good for large companies but not for small companies as they need to create and iterate applications quickly.