Chapter 7, API Management and Consumption Patterns Flashcards
What is API Management?
API management is the process of creating, managing, securing, analyzing, and scaling APIs on top of existing microservices.
412
What does API management enables consumers of your cloud native application to do?
- Have better engagement with the APIs you expose
- Integrate your application with other services and build new capabilities
- Monetize the consumption of your APIs
- Generate business analytics and insights
- Expose business capabilities as managed, secure, and resilient
412
Describe the API Gateway Pattern
The API Gateway pattern is the most common way of exposing the business capabilities of your cloud native application to the consumer. With this pattern, you put a separate layer in front of the capabilities that are designed as microservices and that you wish to expose to consumers. With this approach, an API gateway acts as the front door to your cloud native applications.
414
How does the API Gateway Pattern work?
An API gateway layer is often built on top of existing microservices. Any microservices or composite services that you develop can be exposed as managed APIs through the API gateway. The API gateway operates alongside the API control plane and developer portal.
414
Describe the API creator/API developer role in a typical API management process
A person in a technical role who understands the technical aspects of the API (including interfaces, documentation, and versions) and uses the API publisher to provision APIs into the API store. The creator or developer uses the API store to consult ratings and feedback provided by API users. Creators and developers can add APIs to the store but cannot manage their life cycle.
414
Describe the API publisher role in a typical API management process
Manages a set of APIs across the enterprise or business unit and controls the API life cycle, subscriptions, and monetization aspects. The publisher is also interested in usage patterns for APIs and has access to all API statistics. (In certain cases, the API creator and publisher roles may be combined into a single role.)
414
Describe the Application developer role in a typical API management process
Uses the API store to discover APIs, read the documentation and forums, rate/comment on the APIs, subscribe to APIs, obtain access tokens, and invoke the APIs.
414
Describe the API control plane admin role in a typical API management process
Hosts and manages the API management solution. This person is responsible for creating user roles in the system, managing databases, and ensuring security.
414
What are the key steps of API life-cycle management?
1) We identify the business capabilities that we are going to expose as managed APIs.
2) The API creator (this can also be a person who develops services) creates a managed API (or API proxy) on top of the corresponding microservices of the business capability. The downstream services can be individual microservices or service compositions. The API is created at the API gateway.
3) API publishers can publish the APIs that are created so that they are available in the developer portal to be discovered by the application developers.
4) Application developers subscribe to APIs that they wish to consume through the API developer portal and learn more about the API so that they can consume applications on top of those APIs.
5) The applications that consume those APIs (such as mobile, web, or desktop applications) send requests via the API gateway to consume the business capabilities.
6) API publishers and creators control, observe, and manage the API exposed to the consumer.
415
What are some considerations when using the API Gateway Pattern?
- The API gateway layer should not have business logic–related capabilities. To have better separation of concerns, the underlying service should take care of the business capabilities.
- We can have multiple API management layers to expose APIs to internal and external consumers.
- At the initial stages, you may require only an API gateway, while the API control plane and developer portal are not mandatory. API publishing, and obtaining the information on published APIs, can be supported via dedicated interfaces of the API gateway (for example, the REST API).
- As your API management requirements become more advanced, you will need dedicated API control plane and developer portal components. Depending on the requirements, you also can adopt new components to handle API monetization, traffic management, and so on.
- The API gateway layer is often used as a monolithic runtime. If the gateway layer does any heavy lifting related to security, policy enforcement, and so forth, you may have to split it into multiple runtimes. The API Microgateway pattern that we discuss next can be used in such scenarios.
420
What are some related patterns to the API Gateway Pattern?
API management patterns can be used along with any of the service composition patterns that we discussed previously. We can use different variations of the API Gateway architecture to cater to specific requirements of cloud native applications. These variations are discussed in “API Microgateway Pattern” and in “Service Mesh Sidecar as an API Gateway Pattern”.
421
Describe the API Microgateway Pattern
The API Microgateway pattern is a simple variation of the API Gateway pattern. The key idea is to make the API gateway a distributed component so that each API deployed in the API gateway has an independent runtime. So, the API gateway is no longer a monolithic component in this pattern.
421
How does the API Gateway Pattern work?
In the API Gateway pattern, the API gateway component hosts the runtime for all APIs that we expose through our API management layer. However, when the number of APIs that we expose grows, this monolithic API gateway layer can become really bulky and will start giving us all the problems of a conventional monolithic application. And a monolithic API gateway layer goes against some of the core principles of microservices in a cloud native application.
The APIs that we expose from an API management layer represent business capabilities that are designed, developed, deployed, and managed independently. Therefore, a true cloud native application shouldn’t have a monolithic or central API gateway layer. Instead, each API should have its own runtime—called a microgateway—and we should be able to manage all these runtimes together by using a central API management plane that is exposed via a central API developer portal.
421 Figure 7-3. API management with microgateways
How is the API Gateway Pattern used in practice?
A microgateway is usually implemented using a lightweight gateway runtime deployed as a container. Therefore, we can leverage containers and container orchestration systems to run microgateways.
423
How is the API Gateway Pattern used in practice?
A microgateway is usually implemented using a lightweight gateway runtime deployed as a container. Therefore, we can leverage containers and container orchestration systems to run microgateways.
423 Figure 7-4. API microgateways in action
What are some considerations when using the API Gateway Pattern?
The API Microgateway pattern requires support from the underlying API management platform to have such a decentralized deployment of the gateway. Since we are using one gateway for each API, the gateway runtime must be extremely lightweight. When it comes to managing and scaling such a decentralized system, we need a container orchestration system such as Kubernetes to handle the operational overhead. In most API management solutions offered as cloud services, the existence of the microgateway is transparent, and the cloud service takes care of handling it seamlessly.
424
What are some related patterns to the API Gateway Pattern?
The API Microgateway pattern uses the same terminology as the API Gateway pattern.
The Service Mesh Sidecar as an API Gateway pattern is an application of the Microgateway pattern in the context of service mesh.
424
Describe the Service Mesh Sidecar as an API Gateway Pattern
The key idea behind the Service Mesh Sidecar as an API Gateway pattern is that, in an environment where we use service mesh, rather than using a separate API gateway runtime, we can offload the tasks of the API gateway to the sidecar proxies running alongside each microservice.
424