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 ?
CodePudding user response:
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.