Service discovery for microservices

Deepak Pant
1 min readSep 25, 2019

--

Service Discovery:

In the world of microservices there must be a “way/method” to identify where a particular service reside (IP and port)”. In a typical cloud environment the service instances are added and removed dynamically. Service discovery become a essential part of deployment

Two flavors :

  1. Client side: Most of the code to query the DB (or the service registery system) and load balancing lie in the client side. More complex code as load balancling and DB query part is stattered in all the client
  2. Service side: a Load balancer (or Load balance as a service) abstract away the detail of service discovery (querying the DB or service registery) and balacing to the client. Client just request it to load balancer. AWS, ELB (elastic load balancer) is one such instance.add ress of the load balance can be queried from the DNS https://aws.amazon.com/elasticloadbalancing/

You have to imagine that in the above system service registery is the key component. Each service instance need to register itself to a service registery via register(“serviceName”,10.2.1.2:8007). We have to either use heartbeat() or leash expiry or a client unregister() mechanism for health checks.

Kubernetus handle service instance registration and deregistration automatically.

  • Your service registery should be also highly available (fault tolerant) and scalable
  • Zookeper can be used to keep the service registery database
  • Netflix Eureka is also a good example of service registry

More details:

--

--

Deepak Pant
Deepak Pant

Written by Deepak Pant

Engineer, thinker and designer

No responses yet