I am contemplating the use of the design pattern API Gateway, specifically the Backends for Frontends derivative.
We have a number of 3rd party software packages that expose an API. Over the course of the past few years I have been creating custom APIs as wrappers for the functionality of these 3rd party APIs. These function in ways that make sense to our business processes.
As the number of applications (web and other) grow, it seems more like it would fit the API Gateway pattern so that we can loosely couple the custom APIs to the apps that use them. As well as tailor our API Gateway to function as a Facade for the client applications. We also need to start communications between the 3rd party software applications (integrate them with each other), as they don't currently offer any built in support.
We have mostly web applications, but we have also added a mobile application. The future could bring more mobile apps, but we will certainly be creating more web apps along the way. Some of these will be internal, some may be for clients outside our network, and some may be for external use, hence I got the idea for the API Gateway - Backends for Frontends idea.
Design References:
As I have never designed something like this before, I was wondering the following:
- Have you experienced any other negative consequences from using this pattern other than these:
Source: microservices.io - patterns-apigateway
The API gateway pattern has some drawbacks:
Increased complexity - the API gateway is yet another moving part that must be developed, deployed and managed
Increased response time due to the additional network hop through the API gateway - however, for most applications the cost of an extra roundtrip is insignificant.
(削除) 2. As I am using the MVC pattern for the API Gateway, would you use a separate controller for each custom API it represents? Can you provide some guidance on structuring the controller(s) and routing recommendations? (削除ここまで)
- The documentation I have read, recommends using a single endpoint, which seems odd, as I wouldn't think you'd want to route everything through the same endpoint (method), ChatGPT told me differently and that using multiple controller(s) with multiple endpoints makes sense, perhaps I am misconstruing what they mean by a single endpoint (do they mean the base url?).
Reference - Microsoft - MSDN
Use the gateway as a reverse proxy to route requests to one or more backend services, using layer 7 routing. The gateway provides a single endpoint for clients, and helps to decouple clients from services.
-
1@Community Unhelpful. The question is specific in it's context and question(s)Ryan Wilson– Ryan Wilson06/29/2023 17:47:45Commented Jun 29, 2023 at 17:47
-
1@RyanWilson to say it a little more clearly, our Q&A format needs questions that have a single objective answer so that the votes mean something. Questions asking for an open ended list of things don’t work well here. We don’t do opinion polls.candied_orange– candied_orange06/29/2023 19:16:09Commented Jun 29, 2023 at 19:16
-
1We used to send people to Reddit but it’s a dumpster fire right now.candied_orange– candied_orange06/29/2023 20:43:17Commented Jun 29, 2023 at 20:43
-
1@guillaume31 My bad. I thought I had the link to Microsoft that contained that statement linked as the first link. Added it as a block quote and the reference to the article after #3. Please see editRyan Wilson– Ryan Wilson06/30/2023 11:39:03Commented Jun 30, 2023 at 11:39
-
1I think they mean "endpoint" in a general sense, not "API endpoint". A single server/service if you will, not a single resource/URI.guillaume31– guillaume3106/30/2023 11:46:08Commented Jun 30, 2023 at 11:46