Microservice architecture aims split off an applicationâs set of functionalities into small, specialised services that run inside containers. In this architecture, âchange is a first-class design considerationâ (from the âFundamentals of Software Architectureâ).
Microservice architectures try to solve scaling challenges faced by monolithic applications.
- When some functionality in your monolithic app receives significantly more traffic than another, you canât really scale that functionality up independently. Youâd have to deploy another instance of your whole monolithic app. In microservice architectures, when service is experiencing a lot of traffic, you simply spawn another instance of service .
- If your monolithic app is written in Java, then new functionalities must also be written in Java.
- When the codebase for your monolithic app is huge and everything is deeply intertwined with each other like spaghetti, itâs harder for developers to add new things, fix bugs and maintain. In microservice architectures, the services are separated by and communicate through well-defined abstractions so developers can specialise in a smaller part of the overall application.
- Failures in one part of the monolithic app might just crash the whole system. In microservice architectures, failures in one service are isolated to that service.
- If you update one part of a monolithic app, the entire app needs to be re-released, basically. In microservice architectures, every service can go through an independent CI/CD pipeline and updates to services are independent of one another.
In essence, microservice architecture is just a way of decoupling the parts inside a monolithic architecture.