Microservices architecture involves breaking down a software application into smaller components, rather than just having one large software application. Typically, this involves dividing a software application into smaller, distinct business capabilities. These can then communicate with each other via an interface. Microservices are an architectural style used to build an application which is best suited for a large, complex system. A microservice-based application contains loosely coupled, small, independently-deployed projects. Outlined below are the pros and cons of using microservices in applications.
Pros: Advantages of Using Microservices
- Each service is relatively small, so it is easier to maintain code and reduce build time.
- We can add more features in less time compared to monolith applications.
- Each service can be deployed independently, and we can do releases more aggressively.
- Easy to scale (horizontal scaling).
- Different technology stacks can be used in different services.
Cons: Disadvantages of Using Microservices
- Limited tooling support available to deal with complexity in microservice-based applications.
- Difficult to create a testing environment.
- Memory/bandwidth consumption will be increased.
- There is no support for transactions.
- One should have domain knowledge to break functionality into individual services.
- Must deal with the problems of a distributed system.
- Performance might be reduced.
- Not suitable for small applications.