By: Jeremy Pedersen
I want to talk about a service today that hasn't gotten enough love: API Gateway.
The API Gateway service is a critical piece of middleware: it's a cheap, easy way to add a layer of abstraction between what your applications (and customers) see, and what's actually happening on the backend.
Essentially, API Gateway lets you expose services as RESTful APIs, managed by the API Gateway service itself. This means a lot of the heavy lifting associated with setting up an API is done for you.
API Gateway gives you a way to handle an API's full lifecycle, including things like:
The very best thing about API though is something else entirely: it adds a layer between your backend - whatever it might be - and the users of your API.
This is excellent, because it means you can change how your backend is implemented without affecting the applications that call your API.
Alibaba Cloud already has extensive documentation for the API Gateway service, which you can find here, so I'm not going to get into the nitty-gritty in today's post.
Instead, I want to answer questions about API Gateway that frequently come up during Alibaba Cloud training sessions. Here we go!
Q: Does API Gateway offer any kind of developer portal, or offline development tools like an IDE?
Unfortunately no. However, you can:
Q: Can API throttle API requests by total bandwidth, rather than number of requests?
Not at the moment. You can only limit calls to API Gateway based on number of requests, not total bandwidth used.
Q: Can API Gateway periodically make requests to the backend on its own, (say, to "pre-heat" a serverless function)?
Unfortunately no. However, if the backend behind API Gateway is Alibaba Cloud Function Compute (Alibaba Cloud's serverless computing tool), you can make sure your functions are "hot" by using provisioned mode, which gets around the need to have API Gateway periodically trigger functions on its own.
Q: Can API Gateway cache responses from backend services, so that it doesn't have to query the backend every time a new request comes in?
Yes, see this documentation.
Q: Does API Gateway support OAuth or generic SAML authentication for incoming API requests?
Currently API Gateway supports OAuth and JWT.
Q: Can there be more than one backend service behind a single API endpoint?
Yes, there are many ways to do this:
/products). These APIs can then point to different backend services.
I'm a big fan of learning hands-on whenever possible. I recommend checking out the Quick Start guide in the API Gateway docs.
Hopefully I'll have time to do a couple more blogs on this in the future. See you next week!
JDP - December 23, 2021
JDP - May 27, 2022
JDP - October 28, 2021
JDP - April 29, 2022
JDP - August 27, 2021
JDP - May 6, 2022
API Gateway provides you with high-performance and high-availability API hosting services to deploy and release your APIs on Alibaba Cloud products.Learn More
OpenAPI Explorer allows you to call an API through its web interface or WebCLI, and view the entire process.Learn More
Accelerate AI-driven business and AI model training and inference with Alibaba Cloud GPU technologyLearn More
This solution provides you with Artificial Intelligence services and allows you to build AI-powered, human-like, conversational, multilingual chatbots over omnichannel to quickly respond to your customers 24/7.Learn More
More Posts by JDP