Hi, everyone, and welcome back.
Now in today's video, we are going to discuss about the basics of API gateway.
Now, before we discuss about API Gateway, let's quickly revise our understanding about the IPAS.
Now, at a high level overview APIs, act as a front door for applications to access the data business
logic as well as functionality from your backend service.
So this can be explained with this diagram where you have some kind of a backend system and you have
some kind of a clients.
So for the clients to connect to the backend system, they can go ahead and connect to the API.
And based on the things that are allowed at the API level, certain data or business logic can be achieved.
Now, one of the important things as part of this architecture is the API.
In case if this API goes down, then all of your global customers will not be able to access to your
backend system.
And this is the reason why the API should be highly available and should also be able to handle thousands
of requests.
Apart from that API should also have the necessary level of security.
You do not really want the global clients to perform some dangerous operation at a backend system level,
so whatever API that you create, it needs to be secure and it needs to allow the things that are required
and not all the functionalities.
And apart from that, in the larger organizations, you have a lot of requirements related to the authentication
at the API level, the caching at the API level, the throttling and so many others.
And in order to achieve this, you have the Amazon API Gateway service at a high level overview.
The API gateway is a fully managed service that makes it easy to create, publish and maintain as well
as secure the APIs at any scale.
So what do you do?
You go ahead and create the API through the API Gateway service and the APIs that you create.
You will be able to achieve a lot of functionalities there.
For example, you can have request throttling, you can have the authentication, you can have caching
and so many other functionality which generally the production environments require.
So let's do one thing, let's directly jump to the demo to understand this in more detail.
Now for today's demo I have a Halo world lambda function and all it does is that whenever it executes
it prints Halo from lambda.
Now you see that this function is also connected with the API gateway, so you can consider this lambda
function to be the backend system.
And we also have certain set of APIs.
For example, you see we have certain set of APIs and this is the API.
So whenever the global users, they connect to the API, the API will execute the lambda function and
in the response, the halo from Lambda will be sent back to the clients.
So let's go ahead and try it out.
So I'll quickly open the API and you see we got the invoke UI, I'll copy this, invoke URL and from
the browser when I add this.
In the response you get Halo from Lambda.
Now, again, note that this is a very simple response.
However, depending upon the use case, the backend system or lambda can perform different set of use
cases as well.
Now, as we were discussing that, since this API is an entry point for your backend system and you
can have thousands of global users, it is important that whatever API that you create needs to be highly
available as well as secure.
Now, since we are creating the API through API Gateway API, Gateway in turn provides the overall high
availability as well as various security related features that we can integrate as part of the API.
For example, I have one more API that is available over here, and in this API you see that there is
an API key which is required.
So whenever a request is sent to this specific API, not all of the users across the internet will be
able to perform the operation.
Only the one that has the API key will be allowed.
So let us also quickly look into it in more detail.
Now, if you look into the end point that this API provides, again, this is the end point, let's
quickly copy this and add it within the browser.
And this time, you see we are getting a message of forbidden.
So this specific API is secure.
So you have to authenticate to this API.
Now, from the CLA, I have a specific API key that can authenticate to the API and through this specific
API key, when we send a request to the specific API, we get a response of halo from Lambda.
All right.
Apart from that, there are a lot of features that API Gateway offers.
So you have the API cache, you have the throttling, you can integrate a web application firewall,
you can integrate client certificates.
Apart from that, you have logs and tracing the deployment history and so many others.
Great.
So I hope with this you understood the benefits of creating the API through the API Gateway service
and with this will conclude today's video.