Chapter 7, API Management and Consumption Patterns gpt Flashcards

1
Q

What is an API or API proxy in a cloud native application?

A

An API or API proxy represents a business capability of a cloud native application exposed to consumers in a managed way, typically backed by one or more backend microservices and hosted in a separate API gateway runtime.
Page: 413

An API or an API proxy represents a business capability of your cloud native application that is exposed to consumers in a managed way. An API may be backed by one or more backend microservices and is usually hosted in a separate API gateway runtime.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Where should the business logic reside in a cloud native application?

A

The business logic should reside with the backend microservices, while the API should only provide capabilities such as security, throttling, and versioning.
Page: 413

The logic of the business capability that we expose should reside with the backend microservices, while the API provides only capabilities such as security, throttling, versioning, and so on. We should try to avoid putting business logic in the API layer, as the underlying service is responsible for supporting the required business logic.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Can a single API offer multiple backend microservices?

A

Yes, a given API can offer multiple backend microservices. For example, an order API can be backed by an order management capability and an order status capability hosted in different contexts.
Page: 413

A given API can offer more than one backend microservice (for example, an order API can be backed by an order management capability hosted at :/order/management services and an order status capability hosted in a different context (order/status).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Should service orchestrations be created at the API layer?

A

No, it is not recommended to create compositions such as service orchestrations at the API layer.
Page: 413

But we do not recommend creating compositions such as service orchestrations at the API layer.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How are APIs usually exposed?

A

APIs are usually exposed via REST/OpenAPI or GraphQL.
Page: 413

APIs are usually exposed via REST/OpenAPI or GraphQL.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is an API product and how is it used?

A

An API product is used to present an API to developers via the API developer portal, usually mapped to a high-level business capability and consisting of one or more APIs.
Page: 413

An API product is a concept occasionally used when it comes to presenting an API to developers via the API developer portal. The API product has one or more APIs and is usually mapped to a high-level business capability. For example, in cloud storage services, Storage Services can be the API product, while we can have multiple APIs such as the File API, Blobs API, and Disk API under that one API product.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the API gateway and its purpose?

A

The API gateway is the front door to your APIs, responsible for accepting API calls, applying security validations, quality-of-service attributes, and collecting observability and analytics data.
Page: 417

API gateway: The API gateway is the front door to your APIs. The APIs that you create in front of the downstream microservices are hosted inside the API gateway runtime. None of the roles that we’ve discussed directly interacts with the API gateway, but the API consumers do (for example, the consumers of the mobile and web applications that are built on top of the managed APIs). The API gateway is responsible for accepting the API calls and applying security validations such as tokens, certificates, and other credential validations. It also applies various quality-of-service attributes to the API calls, such as throttling (quotas, rate limiting), caching, and versioning. In certain scenarios, you may also implement lightweight transformation logic (such as JSON to XML, or minor changes to the payload), but again we should not try to expose any logic related to the business capability of the API that we offer. An API gateway is also responsible for collecting all the data related to observability and API analytics.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What should not be exposed in the API gateway?

A

Business capability logic should not be exposed in the API gateway.
Page: 417

In certain scenarios, you may also implement lightweight transformation logic (such as JSON to XML, or minor changes to the payload), but again we should not try to expose any logic related to the business capability of the API that we offer.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the API management plane and its functions?

A

The API management plane is the main interface used by API creators and publishers to control and administer APIs, manage API access policies, users, schemas, and API visibility.
Page: 417

API management plane: The API management plane is the main interface that the API creators and publishers use to control and administer the behavior of the APIs hosted through the API gateway and developer portal. Using the control plane, we can define and create APIs (and API products), change the life-cycle state of the APIs, and manage API access policies such as throttling, caching, security, and versioning. Management of users, schemas, and API visibility are also done at the control plane.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What functionalities does the API developer portal provide to developers?

A

The API developer portal allows developers to discover, learn about, try out, subscribe to, rate, and provide feedback on APIs, as well as generate security keys and tokens and obtain usage analytics.
Page: 418

API developer portal: The developer portal is where you present your APIs to the application developers so they can discover and learn about your APIs, try them out, subscribe to them (or to API products), rate them, and provide feedback. (This is similar to the concept of an app store that you usually find with mobile devices such as iPhone or Android). The developer portal also allows developers to generate required security keys and tokens and use them when building applications that consume those APIs. Developers may also use the developer portal to obtain analytics on their own usage.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Which components are mandatory and optional in the API Gateway pattern?

A

The API gateway is mandatory, while the management plane and developer portal are optional based on the use case.
Page: 418

The API gateway is a mandatory component for implementing the API Gateway pattern, and the rest are optional. Based on your use case, you can choose whether you need a management plane or a developer portal.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How is the API Gateway pattern used in practice?

A

It is used as a facade on top of existing microservices, with capabilities exposed as APIs through either a bottom-up or top-down approach.
Page: 418

How it’s used in practice: The API Gateway pattern is usually used as a facade on top of existing microservices. Not all your microservices need to be exposed as APIs. When you want to expose a certain capability as an API, you first create a microservice that caters to that capability and then you can create an API by using that microservice as the backend.
Figure 7-2 shows the Order API exposing the business functionalities related to order management in an online application. This requires multiple services to interact, and we may use the Service Orchestration or Service Choreography patterns to implement the service composition. Once we have the composite service (Order service, in this case), API creators/publishers can create an Order API by using the API management plane, and then publish it. Once you publish the API, it becomes available in the developer portal for the app developers. They can then build apps that consume the Order API.
The applications that are built to consume the Order API send requests to the API gateway, where security, throttling, caching, versioning, and other policies are enforced. Since we start from microservices and then expose APIs later, this approach is known as a bottom-up API management technique.
The API Gateway pattern can also be used in a top-down approach, in which we start with the API design. Depending on the use case, this approach requires us to first design the API and then delve into the implementation, where we develop one or more microservices and their interactions.
Top-down API management is usually suitable when you have API management requirements at the time you start building a cloud native application. If you are adopting API management later into the development of your cloud native application, the bottom-up approach works better.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the bottom-up API management technique?

A

The bottom-up API management technique starts with microservices and then exposes APIs, suitable for adopting API management later in development.
Page: 418

Since we start from microservices and then expose APIs later, this approach is known as a bottom-up API management technique.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the top-down API management approach?

A

The top-down API management approach starts with API design and then develops microservices, suitable when API management requirements are defined at the beginning.
Page: 418

Top-down API management is usually suitable when you have API management requirements at the time you start building a cloud native application.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How does the Service Mesh Sidecar as an API Gateway Pattern function?

A

It involves using a sidecar proxy to function as the API gateway, controlled via the API management and service mesh control planes, allowing microservices to be exposed as APIs.
Page: 424

How does the Service Mesh Sidecar as an API Gateway Pattern work?
Suppose you are already using a service mesh to run your microservices and want to include API management in the same deployment. For the microservices that you want to expose as APIs, you can leverage a sidecar proxy to function as the API gateway in addition to supporting the normal service mesh capabilities. Each service mesh sidecar proxy that is colocated with the microservices can also be controlled via the API management plane and service mesh control plane.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Who interacts with the service mesh control plane versus the API management plane?

A

Service developers or DevOps interact with the service mesh control plane, while API creators and publishers manage the API lifecycle through the API management plane.
Page: 424

The type of users who interact with the service mesh control plane are different from those who interact with the API management plane. Service developers or DevOps primarily control the service mesh behavior, while API creators and publishers manage the API life cycle.

17
Q

What are the similarities between a service mesh sidecar proxy and an API gateway?

A

Both the service mesh sidecar proxy and an API gateway intend to work as proxies and are controlled by separate control planes.
Page: 424

One of the main reasons for using a sidecar proxy as an API gateway for each microservice is that the requirements of a service mesh sidecar proxy and an API gateway are similar. Both intend to work as proxies and are controlled by a separate control plane.

18
Q

How can a capability be exposed as a managed service using the sidecar proxy?

A

By selecting a capability implemented as a separate microservice and converting it to an API through the API management control plane, it can be published to the developer portal and served via the sidecar proxy runtime.
Page: 424

So, when we need to expose a capability as a managed service, we select the capability that is often implemented as a separate microservice (if no such service exists, we have to build it). Through the API management control plane, you can convert it to an API that is published to the developer, stored, and served via the same sidecar proxy runtime.

19
Q

What components typically comprise a cloud native application?

A

A typical cloud native application includes microservices, a messaging infrastructure, data stores, and frontend applications that expose capabilities directly to consumers.
Page: 428

In a typical cloud native application, we have a collection of microservices, a messaging infrastructure, data stores, and frontend applications that expose capabilities directly to consumers. So, frontend and backend connectivity patterns are built around the ways that you can integrate frontend applications (such as web, mobile, and desktop applications) with the backend microservices and systems.