What is the advantage of registry discovery service versus api gateway?

Issue

A discovery server allows a client to discover existing services. It does not depend on a fixed url.
However an api gateway with routing function also allows to contact services with only a url.
In one case as in the other the client depends on a url so what is the difference ?

Solution

The purpose of the registry discovery service is to discover services for which the IP is not known and to monitor them.

The purpose of the API Gateway is to serve as an entrypoint for the client. It can handle things like authentication, logging, request filtering, etc, before redirecting the client to the appropriate service.

These types of services have different purposes and usually work together, so it’s not one versus the other.


For example, let’s imagine the following scenario with 5 services:

  • API Gateway
  • Registry Discovery Service
  • Authentication Service
  • Customer Service
  • Adds Service

The client would call the API Gateway. For each request, the API Gateway would validate the request, if not authenticated, it may redirect the user to Authentication Service, and if authenticated it redirects the user to either Customer Service or Adds Service depending on the url pattern. To find the actual addresses of the target Service it uses the Registry Discover Service.

Answered By – Alexandru Severin

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published