PRIYANKA VERGADIA: Hi, I'm Priyanka.
And today, I'll be talking to you about serverless API
development.
After a quick introduction, I'll also
provide a demo of how to build and manage
serverless APIs with the Google Cloud API Gateway.
So stick around.
[MUSIC PLAYING]
Adoption of serverless computing offers a profound paradigm
shift in developers' ability to create highly scalable
applications and services.
This architecture considerably improves the way
modern applications and services are created
by allowing developers to build without worrying
about the setup and maintenance of the underlying
infrastructure.
And by adding an API facade to these serverless applications,
developers can seamlessly connect data,
integrate systems, and build modern applications.
As organizations are expanding their API programs,
a key question continues to come up--
how do we make APIs lightweight on the client side
yet highly scalable and secure to meet the changing traffic
demands?
To accomplish this, many organizations
have been migrating their business-critical APIs
to serverless architecture.
Developers package services functions
as RESTful APIs to increase security of their services
with monitoring and controlling access to data,
protecting these services from bot
attacks and other malicious traffic,
improving performance with rate limiting and caching,
and identifying important insights from analytics data
extracted from monitoring, alerting, logging, and tracing.
With Google Cloud API Gateway, you
can create, secure, and monitor APIs
for Google Cloud serverless back ends.
It enables you to provide secure access to your back end
services through a well-defined REST
API that is consistent across all your services
regardless of the service implementation.
It can manage APIs for multiple back ends,
including Cloud Functions, Cloud Run, App Engine, Compute
Engine, and Google Kubernetes Engine.
Built on Envoy, API Gateway is fully managed by Google Cloud
to give you high performance, scalability, and the freedom
to focus on development.
API Gateway gives you all the operational benefits
of serverless APIs while reducing
the complexity of implementation,
such as flexible deployment and scalability,
so that you can focus on building great applications.
Additionally, Google Cloud API Gateway
adds layers of security control, such as authentication
and key validation, by configuring
security definitions that require all incoming calls
to provide a valid API key.
It also allows you to set quotas and specific usage
limits to protect your APIs from abuse or excessive usage.
Let's take a quick look.
Here at Google, we continue to see
a lot of developers building their APIs on top
of microservices.
So in this example, we've deployed a weather API
on Cloud Run.
It's made up of four different services.
This is great for you as an API provider,
because it gives you a lot of flexibility
around how you deploy and scheme these services.
But as an API consumer, you don't
want to keep track of which service
is responsible for which piece of the API.
You just want one interface that you
can call to access all the capabilities provided
by this API.
So let's take a look at how Google Cloud's API Gateway can
help you combine all these services into one
easy-to-use API.
To get started, we will need an OpenAPI specification
that defines each of the resources in our API.
Next, we will add instructions that
tell the API gateway where to route the request for each
of those resources.
And finally, we will want to secure our APIs.
So we will configure a security definition
that requires all the incoming calls to provide a valid API.
Once we have our OpenAPI specification
and we are ready to create our API gateway,
first we'll specify the display name
and give our API a unique identifier.
Next, we will define the API's initial configuration
by uploading our OpenAPI file.
We'll then give our configuration a display name
and configure the service accounts
that will be used to call our back end services.
And finally, we are ready to deploy our API configuration
to a new gateway.
In this case, that gateway will run in the US central region.
Once we hit Create, after a few minutes
our gateway will be ready to start accepting incoming API
requests.
Because we have secured our API, we will need valid credentials.
In this case, we have elected to use API keys as our security
mechanism.
So we can get an API key for our API in the APIs and Service
section of the Google Cloud console.
Once we have our key, we can make an API call
from the command line using Chrome.
If we tried to access our API without providing a key,
the call would be affected by the gateway.
Once we add our key to the request,
the gateway then allows our call to go through successfully.
That was just a quick preview of how
you can use Google Cloud API Gateway to create and secure
your APIs.
You can leverage API Gateway for a number of important use
cases, such as abstracting back end complexity to facilitate
development for web and mobile applications;
connecting users to in-house and third-party APIs and services,
especially those provided by Google Cloud; controlling
access for partners while rate limiting the number of calls
from each partner; and extending data services to enable
frictionless service-oriented access to data.
Now it's your turn to try it out.
Get started by clicking the link in the description below.
[MUSIC PLAYING]