Most of the organizations have implemented microservices in their respective problem domain and are benefiting on various aspects. All these points we will be discussing in this post. Lot of large corporations such as Twitter, Netflix, Amazon, PayPal, Uber, Spotify etc have adopted the microservices architecture. If you are still not aware of what microservices are and why do we need it, click on this to read more.
Below are the key advantages of microservices.
Table of Contents
Technology Heterogeneity
In the microservices architecture, it is not mandatory for you to use the same programming language for all the microservices in a domain or an organization. You can choose to implement a microservice in any language of your choice based on the advantages that specific programming language provides. Example – You can implement Java for a set of microservices or golang for another and Ruby for another. There are so many programming languages and each has their own advantage over the other and can be used in a specific use case. Most commonly it has been observed that organizations are using a single or at most 2 languages. One of the disadvantages of using different languages for different microservice is that, if you want to shift developers between teams then it will be difficult for the developer to learn the other language as well.
Resilience
Resilience means if one component of the system fails, that failure does not cascade, you can isolate the problems and the rest of the system can carry on working. In a monolithic service, if the service fails everything stops working, this can be avoided if we run the service on multiple machines to reduce the chance of failure. This can be achieved by deploying our services to multiple data centers. If one of the data center gets down due to network issue the traffic can be routed to the data center that is up and running.
Scalability
Scaling means increasing the number of instances of a microservice. For a particular application there can be a feature or functionality that is most used by the consumers E.g. Search bar or product searching on amazon shopping website. In this case we can increase the number of instances of search microservice. And this specific service can be run on a more powerful hardware. And other services can run on less powerful hardware.
If we can implement this feature in a monolithic application, we have to scale the whole application. If we want to scale a small part of the application we cannot because that small part is locked up in a giant application.
This is more cost effective especially when our services are hosted on AWS (Amazon web service) , because instead of scaling all the services and incurring high cost, we can apply the scaling on demand for those pieces that need it.
Ease of Deployment
If a monolithic application has millions of lines of code, and if we make a small change to a simple condition or a loop, the entire huge application needs to be deployed. Such deployments can be high-risk deployments and if for some reason deployment fails, the business impact will be huge. As we go on adding new functionality to the monolithic application, the size of the codebase goes on increasing hence increasing the deployment risk more and more.
With microservices, we can make a change to a single service and deploy it independently without touching the rest of the services. This allows us to get our code deployed faster. By chance If any problem occurs, it can be isolated quickly to an individual service, and rollback that application only.
These are the main benefits of microservices and the reason why most of the large organizations are moving their applications to microservices architectures by decomposing it.
Leave a Reply