当前位置:网站首页>[cloud native] what is the "grid" of service grid?
[cloud native] what is the "grid" of service grid?
2022-07-04 18:06:00 【Digital China cloud base】
What is service grid ? In the article about cloud Nativity , Often with microservices 、 Containers 、 A noun that accompanies concepts such as container orchestration is service grid , Some articles even connect service grid and container 、 Microservices 、DevOps They are listed as the four key technologies of cloud primordial , Its importance can be seen in . So what exactly is a service grid ?
Cloud native cannot be ignorant of the service grid of Technology
In fact, service grid is not an independent concept , It can be said that the service grid came into being after microservices , When talking about service grid, we have to start with micro Services .
Start with micro Services
Simply speaking , When we introduce microservice architecture and enjoy its many benefits , Also inevitably encountered many problems . Most of these problems can be summarized as communication problems between microservice applications , Service grid is a solution to these problems , It is used to manage the communication between micro services in the micro service application .
Microservice architecture “ Angels and Demons ” Like one and two sides
Want to figure out what kind of concept service grid is , A correct path is to find out what kind of problem it solves , That is to ask : What challenges did we encounter when we turned to microservice architecture ? So much so that we need a special microservice communication tool !
Challenges when turning to microservices
Take an online store application as an example , The program consists of several microservice applications , For example, get the requested Web Microservices 、 Payment micro service that realizes payment function 、 Shopping cart microservice 、 Product inventory micro service 、 Database and other micro services . These microservice applications are deployed in a kubernetes On the cluster .
Online store program based on micro service architecture
So what functions do micro services need to implement to make such an online store application run successfully ?
Microservice architecture needs to do
Business logic (Business Logic)
First, each microservice must implement its own corresponding functions .Web Microservices need to handle user interface requests , Payment micro service needs to realize payment function 、 The database needs to process data .
Essential business logic of each microservice
Communication configuration (ommunication Configuration)
In addition, in order to make our online store application run successfully , Not only does each microservice need to implement its own corresponding functions , Communication between micro services is also required .
When the user puts the goods into the shopping cart , At this point, microservices need to communicate with each other ,Web The microservice received a request , Then give it to the shopping cart microservice , The shopping cart microservice then communicates with the database to persist data .
When users add goods to the shopping cart, the communication of microservices
To realize the interaction between microservices like this , We need to configure the corresponding information for the micro service . So when we add new microservices , We need to configure information for all micro services that we need to communicate with , For example, all and Web The microservices of the microservices dialog need to be Web The corresponding information of the micro service configuration . This configuration information is also part of the application deployment code .
Add communication configuration to realize communication between microservices
Security logic (Security Logic)
Microservice applications also need to ensure security .
Usually , In many projects, we are kubernetes The cluster has set firewall rules . There is a proxy as the entry point to get the request first , Therefore, the cluster cannot directly access , Therefore, the application has security around the cluster . But once the request enters the cluster , Communication is not secure . Every micro service in the cluster can communicate with any other micro service , So there are no restrictions on communication . From a security point of view , This means that if an attacker enters the cluster , Then you can do anything , Because we don't have any additional security inside .
colony “ Internal worries ”
For some small applications, this may not be a problem , Because they don't actually have any user sensitive data , But for some important applications , For example, applications with a large amount of personal user data, such as banking systems , The security of data has to be considered . Therefore, additional configuration is required inside each application , To protect the communication between services in the cluster .
Add security logic to ensure the internal security of the cluster
Retry logic (Retry logic)
In addition, in order to make the whole application more robust , You also need to add retry logic for each micro service . That is, when a microservice cannot be accessed , Or lost the connection , At this time, you need to try connecting again .
Retry after disconnection
Therefore, developers need to add retry logic to the service .
Add retry logic to make the microservice architecture more robust
monitor (Metrics and Tracing)
When the microservice application is running , We also need to monitor the implementation of services , Like what http error 、 Get the number of requests received or sent by the microservice 、 Understand how long the request takes to identify bottlenecks in the application , Therefore, developers also need to add monitoring logic for microservices .
Add monitoring logic
You can see , In order to make the microservice application run successfully , The development team of each microservice needs to deal with the business logic of each microservice , You also need to add many other logic irrelevant to the actual business to each micro service , And you may also need to configure some additional things in the cluster , This is when the problem arises .
Problems arise
There is a lot of extra logic to deal with , It means that the developers of microservices cannot concentrate on the actual service logic , Instead, be busy adding security for each microservice 、 The logic of communication . For every microservice , This greatly increases its complexity , When the number of micro services reaches a certain number , It is almost impossible to configure these logic for many micro services one by one .
Configuring logic for many microservices becomes an impossible task
The service grid provides a solution to this problem .
The solution given by the service grid
Instead of adding a lot of logic to each micro service alone , A more reasonable approach is to separate these logic independent of the actual business logic from microservices , Put it into one of its agents , Centralized processing . This applet is a third-party program , We can easily configure the application , There is no need to worry about how the logic is implemented .
Take away the irrelevant logic with business logic , Unified governance
In addition, developers do not have to add agent configuration to the deployment file of microservices , Because the service grid has a control plane , It will automatically add this proxy to each micro service . So now microservices can communicate with each other through these agents , To realize service to service communication composed of control plane , These agents are service grids . So now developers can focus on developing the actual business logic .
Service grid is essentially a network responsible for the communication between microservices , It decouples service governance capabilities from business development , Make developers focus more on business development and innovation . At the same time, the service governance capacity will be sunk to the infrastructure , Leave professional things to professional people , The iterative update of governance capability can also be independent of business . In today's era when microservice architecture is gradually becoming mainstream , Service grid is helping us better realize cloud nativity .
( Some pictures are from the Internet , If there is any infringement , Delete... Now )
边栏推荐
- curl 命令妙用
- People in the workplace with a miserable expression
- The top half and bottom half of the interrupt are introduced and the implementation method (tasklet and work queue)
- 一直以为做报表只能用EXCEL和PPT,直到我看到了这套模板(附模板)
- Perfectly integrated into win11 style, Microsoft's new onedrive client is the first to see
- The money circle boss, who is richer than Li Ka Shing, has just bought a building in Saudi Arabia
- Superscalar processor design yaoyongbin Chapter 7 register rename excerpt
- 你应该懂些CI/CD
- Set the transparent hidden taskbar and full screen display of the form
- Weima, which is going to be listed, still can't give Baidu confidence
猜你喜欢
[HCIA continuous update] overview of WLAN workflow
Offline and open source version of notation -- comprehensive evaluation of note taking software anytype
DB engines database ranking in July 2022: Microsoft SQL Server rose sharply, Oracle fell sharply
KS007基于JSP实现人个人博客系统
Talk about seven ways to realize asynchronous programming
Stars open stores, return, return, return
蓝桥:合根植物
Easy to use map visualization
[test development] software testing - Basics
雨量预警广播自动化数据平台BWII 型广播预警监测仪
随机推荐
With an estimated value of 90billion, the IPO of super chip is coming
通过事件绑定实现动画效果
To sort out messy header files, I use include what you use
Dynamic programming stock problem comparison
You should know something about ci/cd
The Block:USDD增长势头强劲
Clever use of curl command
庆贺!科蓝SUNDB与中创软件完成七大产品的兼容性适配
就在今天丨汇丰4位专家齐聚,共讨银行核心系统改造、迁移、重构难题
Vscode modification indentation failed, indent four spaces as soon as it is saved
估值900亿,超级芯片IPO来了
Cann operator: using iterators to efficiently realize tensor data cutting and blocking processing
Make a grenade with 3DMAX
Set the transparent hidden taskbar and full screen display of the form
How to test MDM products
Recast of recastnavigation
12 - explore the underlying principles of IOS | runtime [isa details, class structure, method cache | t]
Introduction of time related knowledge in kernel
【HCIA持续更新】网络管理与运维
项目通用环境使用说明