Introduction to Microservices in Web Application

Issath Sesni
3 min readJun 6, 2021

--

Image by CodeTiburon

Before we use microservices in web application, first we want to know what is microservices? and why we need it.

What is Monolithic Application

It is a single executable file (exe) for the entire application. So, it is easy to monitor, test and run the application. But the entire application have been packed into one file, So Regression testing is difficult(need to test the entire project), debugging and installation are also difficult. And it is hard to scale, in that case microservices step in.

Monolithic VS Microservice architecture

What is Microservices and why?

Image by Edureka

Simply says, it is an other way of service oriented architecture(SOA). All are independent services, So we can add or remove services independently. It is valuable and practiced some architectural view.

“Do it damn well” — This is Micro service baseline

Let’s list down some features of this

🎈 It is domain driven development (DDD)and it has exact defined scope.

🎈 It runs own process, means does not depend on others.

🎈 It communicates with other services via light weight mechanism. Eg. HTTP, but not limited to HTTP.

🎈 It is capable to deploy independently.

🎈 It is capable to scale independently.

🎈 Able to implement different services using different languages.

🎈 Ability to develop using a smaller team.

Note :- We should maintain decentralized control as much as possible.

Microservices scaling

Some of the key points we should understand about microservices.

🧶Service resilient and fault tolerant :-

This is not a feature, but we have to implement it. Because usually services fail due to network issues and changes made in the system. In this case, we should be able to maintain the failure situation. i.e we can use failover mechanism, proxy, circuit breaker pattern.

Suppose IP address has been changed, in that case, we can use API gateway, governance registry.

🧶 Docker and Container are always moving together. Kubernetes is there to deploy your container.

Advantages

  • Respective team members aware of the service, so when a production issue comes, it is easy to diagnose.
  • Even though it is complex, services are isolated.
  • Independently scalable.
  • If your framework is outdated, then it is easy to migrate to other languages. Because one service does not depend on other service.
  • It is easy to maintain communication from one service to other service.

Disadvantages

  • Dependency management is a centralized process, So the complexity is distributed among services.
  • It is difficult to monitor the app. Because this is not a single application, means multiple services.
  • Integration test is difficult due to several services.
  • It is difficult to Versioning and deployment. Because if you change something in one service, the dependency service will be in trouble.
  • We have to up and run all the services to run the entire application.

“You built it, you own it” — means you need to ensure error- prone and stable services

Hope you all understand an idea of microservices. 😊

References

  1. https://www.youtube.com/watch?v=FO_qg9ETcT0&list=PLD-mYtebG3X9HaZ1T39-aF4ghEtWy9-v3&index=3

--

--