What is Service Discovery in Microservices?

--

Image Credit: https://i0.wp.com/www.dineshonjava.com/wp-content/uploads/2019/07/discovery-service.png?fit=610%2C512&ssl=1

Hello everyone. In this article, let's go through Service Discovery in Microservices architecture.

Monolithic Architecture

Image Source: https://codeopinion.com/wp-content/uploads/2020/12/scale4.png

Before the advent of Microservices architecture, Monolithic architecture was predominant across the web. As seen from the picture above, lets us assume that this is the Monolith application that runs on a physical server on-premise. It has 3 servers and all of them have static IPs and the requests are routed to them using a load balancer. The IP of these 3 servers is stored in a config file usually and is read by the load balancer. In this case, there is no need for a Service Registry as the IP addresses of these 3 APP servers are fixed and won't change.

Microservices Architecture

In the case of a micro-service architecture that is deployed in the cloud, there will be a lot of microservice components for different services. Every microservice can scale differently based on the demands.

The Order service might have 4 or 5 instances and Billing Service might have 2 or 3 instances running. With each instance having a dynamic network address because of…

--

--

Dineshchandgr - A Top writer in Technology
Javarevisited

Principal Software Engineer and Technical Lead focussed on Backend Engineering who likes to upgrade the tech skills and share knowledge to the community