In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces "what is the role of service grid and API gateway in microservice architecture". In daily operation, I believe many people have doubts about what is the role of service grid and API gateway in microservice architecture. Xiaobian consulted various materials and sorted out simple and easy operation methods. I hope to help you answer the doubts of "what is the role of service grid and API gateway in microservice architecture"! Next, please follow the small series to learn together!
and how to make the most of both.
If you work in microservices, you've probably heard these two terms many times. People are often confused between the two. In this article, I'll discuss service grids and API gateways in detail, and discuss when to use them.
Network Layer Refresh
Before delving into service grids and API gateways, let's revisit the network layer. Here is the OSI network layer model:
The reason for this update is that we will discuss some of these layers in the next section.
service grid
Service Grid is a technology for managing service-to-service communication in distributed software systems. The service grid manages network traffic in the east-west direction. East-west traffic represents traffic inside a data center, Kubernetes cluster, or distributed system.
The service grid consists of two important components:
control plane
data plane
The agents that reside next to the application are called the data plane, and the management component that coordinates agent behavior is called the control plane.
A service grid enables you to separate the business logic of your application from networking, reliability, security, and observability.
Network and Traffic Management
Service grids allow you to perform dynamic service discovery. Sidecar agents can help you with load balancing and rate limiting. It helps you split traffic to perform A / B type tests, which is helpful for releasing Canary versions.
Observability and reliability
The service grid supports distributed tracing to help you with advanced monitoring (number of requests, success rate, and response latency) and debugging. It even has the ability to leverage inter-service communication to better understand communication.
Because the service grid provides health checks, retries, timeouts, and circuit breaks, baseline reliability of applications can be improved.
security
The service mesh allows mutual TLS between services, which helps improve the security of service-to-service communication. You can also enforce access control lists (ACL) as security policies.
True service mesh/sidecar agents support a wide range of services and implement L4 / L7 traffic policies.
There are many service grids available on the market. The following are some of them:
Istio
Linkerd
uma
consul
You can find many articles on the Internet comparing the service grids listed above.
API Gateway
API gateways act as a single entry point into a cluster, data center, or set of distributed services. In network topology, it is often referred to as north-south traffic. Typically, mobile clients belong to this type of network traffic.
There is a good chance that people will end up using API gateways to communicate between two products deployed in the same data center. In this case, the traffic type may be east-west.
API gateways receive calls from clients and route them to the appropriate service. In doing so, it can also translate protocols.
There are many benefits to using API gateways:
Abstraction: API gateways abstract the complexity of the microservices underlying them and create a unified experience for clients
Authentication: API gateways can handle authentication and pass token information to services
Traffic control: API gateways can restrict inbound and outbound API traffic
API monitoring/monetization: If you intend to monetize your API, API Gateway can help you do so by providing the ability to monitor client API requests/responses.
Translation: API Gateway can help translate/translate API requests/responses. It can also help with protocol translation.
API gateways typically focus only on L7 policies.
API Gateway Types
From a deployment perspective, API gateways can be used in two ways:
Internal API Gateway: acts as a gateway to a range of services or products
Edge API Gateway: acts as a gateway for consumers or mobile clients of external organizations
There are many API gateways on the market. The following are some of them:
Apigee
API Gateway for NGINX
Software AG API Gateway
When to use what
Now that you know what a service grid and API gateway are, let's try to understand when to use what.
When to use the service grid
When you need L4 / L7 service communication through security and monitoring within the same product scope
When can Sidecar agents be deployed for each individual service instance and its replica
When services can share the same CA certificate to establish secure communication (which may not be possible across products)
When to use API Gateway
When you need L7 service communication through security and monitoring of various products
When you want to expose APIs as products with/without monetization
When you want to provide developers with complete API lifecycle management
When you need to translate service communication protocols
Service Grid and API Gateway Together
Service grids and API gateways are likely to coexist. The following figure shows a scenario where a service grid and API gateway coexist:
At this point, the study of "what is the role of service grid and API gateway in microservice architecture" is over, hoping to solve everyone's doubts. Theory and practice can better match to help you learn, go and try it! If you want to continue learning more relevant knowledge, please continue to pay attention to the website, Xiaobian will continue to strive to bring more practical articles for everyone!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.