We are listening to your every feedback,
and taking action to constantly improve your learning experience.
If you have any feedback, please use this form:
- Click here to access our Premium Algorithms course.
The benefits of Microservices are many and varied. Many of these benefits can be laid at the door of any distributed system. Microservices, however, tend to achieve these benefits to a greater degree primarily due to how far they take the concept behind distributed systems and service-oriented architecture.
Lets take a look at the key benefits one by one:
Technology Heterogeneity: With a system composed of multiple, collaborating microservices we can decide to use different technologies, whichever we think would be appropriate for our use case, inside each microservice instead of having a more standardized, one-size-fits-all approach. We may use Java as the programming language for developing one microservice, while use Go for another and Scala or Ruby for a different one depending on which programming language would be suitable for having improved performance of that respective service.
We may also decide that how we store our data needs to change for different parts of our system which gets the data from different microservices. For example, for a social network, one microservice may deal with users’ interactions and we might store users’ interactions in a graph-oriented database, whereas another microservice may deal with users’ posts and could use document-oriented data store to store the users’ posts.
With microservices we are also able to adopt new technologies more quickly. One of the biggest barriers to trying out and adopting new technology is the risks associated with it. With a monolithic system if we want to try a new technology, database, or a framework, then any change will impact a large amount of the system. Trying a new technology in a microservice has a lot less risk. If I really can rewrite my microservice in two weeks, you may well mitigate the risks of embracing new technology.
Resilience: A key concept in resilience engineering is the bulkhead. If one component of a system fails, but that failure does not cascade, then the problem can be isolated and the rest of the problem can carry on working. Service boundaries become the obvious bulkheads. Due to this reason often each microservice uses its own dedicated connection pool to provide bulkhead so that if one connection pool gets exhausted it impacts only one service and not others.
In a monolithic system, if a service fails, everything stops working. The chance of failure can be reduced by running the system in multiple machines. But, with microservices, we can build systems that can handle total failure of services and degrade functionality accordingly. If one microservice has some issue we may temporarily disable the feature provided by the service thereby degrading the functionality appropriately.
While we are talking about making our microservices more and more resilient, we also need to understand the new sources of failure that distributed systems have to deal with. Networks can and will fail, as will machines. We need to know how to handle these and what impact it may have on the end users of our software.
Scaling Independently: With a large, monolithic service/system, we have to scale everything together. It may so happen that only one small part of the overall system is constrained in performance, but if that behaviour is locked up in a giant monolithic application, we have to scale everything in that system even though only one small component needs the scaling. For a system using microservices, we just scale those microservices that need scaling, allowing to run other services and parts of the system to run on smaller, less powerful hardware.
Ease of Deployment: An one-line change to a million-line-long monolithic application requires the whole application to be deployed in order to release the change. This could be a high-risk, large-impact deployment. The more the addition and modification of code is done, the higher the risk of the deployment.
This is totally different in microservices architecture. With microservices, we can make changes to a single service and deploy it independently of the rest of the system. This allows us to deploy our code faster. If a problem occurs it can be isolated easily, making fast rollback easy to achieve. It also means we can get our new functionalities out to customers faster. Thus microservices remove as many impediments as possible to getting software out the door.
Organizational Alignment: Many developers have often experienced the problems associated with large teams and large codebases. The problem exacerbates even more when the team is distributed. Smaller teams working on smaller codebases are often very productive. Microservices allow us to better align the architecture with the organization, helping us to keep the number of people working on any one codebase minimum to hit the sweet spot of team size and productivity. Conway’s Law is worth giving a look in this context.
- Composability: One of the key promises of distributed systems and service-oriented architectures (SOA) is that they open up opportunities for reuse of functionality. Microservices allow for the functionality to be consumed in different ways for different purposes. Gone are those days when developers only had to think about desktop and mobile devices. Now we need to think about the myriad of ways that a functionality can be used in the Web, native applications, mobile web, tablet app and wearable devices. As organizations move away from thinking in terms of narrow channels to more holistic concepts of customer engagement, microservices architecture would be of more and more help.
- Replaceability: Often we see that some legacy code, which has been written two decades ago, sit in the corner of codebase for years and no one wants to replace this old code. Why? Because this legacy code is too big and too risky a job.
Check out our other System Design content here.
Click here to access our Premium Content on Algorithms .
The above content is written by:
If you have any feedback, please use this form: https://thealgorists.com/Feedback.
Follow Us On LinkedIn