What is a Microservice architecture?
A microservices architecture
is a service-oriented architecture used to build large applications.
The complete picture is a combination of small "services", in which all the modules are independent of each other, but deliver the expected aggregate functionality to the user together. This is done via data sharing amongst the services.
Every team and every product has their own interpretation of how its microservices should look and work, depending on their needs, but mainly they should have:
- A separate project, with separate logic for each service
- Each separate project can sometimes be a separate product itself
- Ideally a separate database for each service
- Separate deployment process for each service
- Designed for failure - the key is if one service fails, others keep working
- A protocol for communication between the services
- A structure and strategy for them achieving the whole functionality of the system
- An API gateway, which will redirect the traffic to the necessary API, without having the end user notice the product is based on many separate services
A service bus implementation, which will help microservices communicate
What are the differences between Microservices and Monolith architectures?
A monolith architecture is generally tightly coupled whereas a microservices architecture is loosely coupled. The focus on microservices architecture is on products rather than projects.
In a monolithic architecture, if a single functionality or any component goes down or breaks, then the entire application could go down. But in a microservice architecture, all components are independent of each other. So if any functionality breaks down then, it is isolated to the service.
In a microservice architecture, any changes implemented in a single data model does not impact that of other services. But in a monolithic architecture, any modifications in the data model could influence the single datastore for the app.
