Service discovery is the automatic detection of devices and offered services over a network. Discovery, which minimizes configuration efforts for administrators, is commonly found in microservice architectures and containerization platforms. Microservices, especially those that are cloud-based, will use service discovery because it can be difficult to detect network locations. For example, service instances are dynamically assigned network locations. Tools which include service discovery features include HashiCorp's Counsul deployment and configuration tool, the Zabbix monitoring software and the Kubernetes containerization platform.
Service discovery functions by using a common network protocol, which allows agents to use each other’s services. Protocols used include Dynamic Host Configuration Protocol (DHCP), DNS Service Discovery (DNS-SD) and Service Location Protocol (SLP).Content Continues Below
The database which contains service instances and network locations is called the service registry. The service registry is made up of server clusters containing databases of available service instances, which should be continually kept up to date.
Service discovery will use two different discovery options pertaining to either the data center initiating
Server‑side discovery allows each client to locate a service using a load balancer. In turn, the load balancer will query the service registry and
Service instances or devices are also registered in one of two ways, the self‑registration pattern or the third-party registration pattern. These patterns allow other devices to find the service. In the self‑registration pattern, a service will register itself with a service registry. The third-party registration pattern uses a service registrar, a separate tool which can ID the service, to register the service. The registrar will record changes to an environment of instances, so if a new device or service is detected, the registrar can then add the service or device to the service registry.