Service Lookup

Also referred to as service discovery, is simply the process of finding services and their related endpoint information. Clients and load balancers need to be able to look up the location of services to send requests. When one service needs to call another service, it will look up endpoint information, and quite possibly health status, when calling the service. Centralized load balancers will often monitor and read this information to maintain a list of back ends for routing and load balancing traffic across multiple instances of a service.

Service Lookup Implementation Options:

DNS-based lookups can be an easy option that requires few changes.

A client framework in the service can be used to look up endpoints and to load balance.

A local proxy on each host can maintain lookup information and proxy requests to the correct service, as well as load balance requests.

The client uses a centralized proxy load balancer that performs lookups. The client will then access the service through a shared load balancer that is responsible for maintaining a list of back-end service instances.

In Figure 5.6 we see a configuration that uses a local proxy, such as NGINX, to route requests. The order service talks to a well-known endpoint like localhost:9001 to call a dependent service, and the local proxy handles the lookup. This can simplify application design, moving the service lookup to a proxy. This is sometimes referred to as an arbiter.

Image

FIGURE 5.6: Diagram showing a local proxy in each host to perform service routing

This approach would also remove the need to develop language-specific frameworks for each language you need to support.


Image More than Just a Routing Proxy

The proxy used to route requests to the appropriate service instances could also provide resiliency implementations to handle concerns like circuit breaker and retry. This would eliminate the need to implement and maintain a library for every language used.


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.139.86.18