1.

What is Service Discovery and how it can be enabled in Spring Boot?

Answer»

In a typical Microservice architecture multiple services collaborate to provide an overall functionality. These set of service instances may have dynamically assigned network locations. Also, the services scale up and down as per the load. It could get tricky in a cloud environment resolving the services that are required for operation for common functionality.

Consequently, in order for a client to make a request to a service, it must use a service-discovery mechanism. It is the process where services register with a CENTRAL registry and other services query this registry for resolving dependencies.

A service registry is a highly available and up to date database containing the network locations of service instances. The two main service-discovery components are client-side discovery and service-side discovery.

Netflix Eureka is one of the POPULAR Service Discovery Server and Client tools. Spring Cloud SUPPORTS several ANNOTATIONS for enabling service discovery.  @EnableDiscoveryClient annotation allows the applications to query Discovery server to find required services.

In Kubernetes environments, service discovery is built-in, and it performs service INSTANCE registration and deregistration.



Discussion

No Comment Found