Hi
I think, API Gateway, I have to mention that the topic is related to service composition. So you first need to answer this question that what is your service composition strategy? Are you going to rely on orchestration or choreography?
Service choreography will not lead you to build an API Gateway because having API Gateway means creating a centralized service cooperation. In a simple word, service orchestration.
Some references recommend the use of API Gateway when the number of Microservices are not more than a few. Which I absolutely agree with it.
Read more here
Microservices in .NET Core: With Examples in Nancy - Christian Horsdal, Christian Horsdal Gammelgaard - Google Books[
^]
But if the number of services is more than a few services then you need a proper service cooperation, discovery, and deployment strategy. Like container-based solutions (For more information see Docker).
Thus, the moral of the story is that API Gateway will rout your requests to the responsive service. That means the service requester will ask the API Gateway to redirect the request to a responsive service (could exist several mirrors of a service with the same responsibilities in Microservice Architecture due to service load balancing) with respecting the target service interface and then receiving the response and delivering it to the service requester again, with the respected service interface.
What does mean this in practice?
1- Build your Microservices based solution by using your preferred technologies and frameworks (like Nancy and OWIN)
2- Define routes to expose HTTP (CURD) functionalities to the rest of system on your services
3- Create another service and call it API Gateway. Note that this service will provide different proxies to access different services (this is more less the same concept of service aggregation).
4- Transfer all requests to the API Gateway because only this service knows end-points that a service can be called and handover the request to the gateway and wait for the response.
I hope this answer will provide at least a good start to solve your problem.
Least but not last, you can read the below article:
Dive into Microservices Architecture - Part I[
^]
Cheers,
-- AH