Introduction to Micro-Services
Introduction
Micro-service is a trending use case of today’s distributed systems. Systems that involves millions of users in their daily transactions. In early days we have used a monolithic architecture, that we built a system as a single unit. Components of the systems were tightly interconnected and interdependent on each other. Due to these reasons, system architects have faced a major problem in maintaining and expanding their services with time. Because in order to maintain the system we had to stop all the current services and do it. This simply reduces the availability of the service to the user. On the other hand, if the system is large and complex to understand, it is difficult to integrate new features or sometimes end up with rewriting the whole application.
In this article we are looking at Micro-service architecture, how it has been evolved and its strength and weaknesses.
What is a Micro-service?
Micro-service is an another architectural style that motivates us to develop systems as a set small services with specific scope, less scale, able to work on their own and communicate with other services through message passing. More oftenly these communications occur as HTTP requests. Decision of decoupling a large system into set of micro-services is based on the business objectives and ability deploy them independently. As a best practice micro-service mange their data source on their own.
According to the above diagram you can clearly visualize how it works. In monolithic architecture it tends to put all its functionality into single process and replicate those processes in multiple instances. But in micro-service architecture, each functionality would be assigned to a separate service and then distribute and replicate as it required.
Let’s now look in to the Pros and Cons of this approach,
Pros
- Easily deployable.
- A Micro-service can be upgraded or maintained without affecting other services.
- Can be scaled easily.
- Micro-services are light scale and has a specific scope which avoids lengthy production cycles.
- We can use different languages to implement different services. e.g. Python, Java.
Cons
- Communication overhead including HTTP calls and (de)serialization.
- Have to rely on communication network.
- Debugging at implementation phase could be complex.
- Each service has to be managed with their own configurations (Increase configuration management).