Member-only story
Service Discovery in Microservices
Service Discovery is one of the key patterns in Microservices Architecture. In this article, we will understand how this is implemented across various technologies including Hashicorp Consul, Kubernetes, and Netflix Eureka.
What is service discovery?
Service Discovery is a pattern that helps in locating the right instance for the client API. Multiple instances of a single Microservice can co-exist. And they can have different IP addresses or different ports or both. As the number of instances for service can vary, we must have a way to track these instances and their addresses.
Three core modules of service discovery include —
- Service Registry: This is a service catalog that maintains the references of all the service instances.
- Load Balancer: This redirects the request to an available instance.
- Health Checker: This module keeps the check on the health of the instances. The load balancer will be redirecting the request only to a healthy instance only.