当前位置:网站首页>[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 )
边栏推荐
- Redis主从复制
- 上市公司改名,科学还是玄学?
- Device interface analysis of the adapter of I2C subsystem (I2C dev.c file analysis)
- Wuzhicms code audit
- Dynamic programming stock problem comparison
- [system analyst's road] Chapter 7 double disk system design (structured development method)
- Vscode modification indentation failed, indent four spaces as soon as it is saved
- Recast of recastnavigation
- Set the transparent hidden taskbar and full screen display of the form
- 12 - explore the underlying principles of IOS | runtime [isa details, class structure, method cache | t]
猜你喜欢
Cann operator: using iterators to efficiently realize tensor data cutting and blocking processing
The company needs to be monitored. How do ZABBIX and Prometheus choose? That's the right choice!
[HCIA continuous update] overview of WLAN workflow
使用3DMAX制作一枚手雷
要上市的威马,依然给不了百度信心
RecastNavigation 之 Recast
超标量处理器设计 姚永斌 第5章 指令集体系 摘录
Developers, MySQL column finish, help you easily from installation to entry
【Hot100】32. 最长有效括号
Solve the El input input box For number number input problem, this method can also be used to replace the problem of removing the arrow after type= "number"
随机推荐
Implementation of super large-scale warehouse clusters in large commercial banks
What is low code development?
【209】go语言的学习思想
R language plot visualization: plot visualizes overlapping histograms and uses geom at the top edge of the histogram_ The rug function adds marginal rug plots
庆贺!科蓝SUNDB与中创软件完成七大产品的兼容性适配
Stars open stores, return, return, return
The top half and bottom half of the interrupt are introduced and the implementation method (tasklet and work queue)
People in the workplace with a miserable expression
Once the "king of color TV", he sold pork before delisting
Five thousand words to clarify team self-organization construction | Liga wonderful talk
Device interface analysis of the adapter of I2C subsystem (I2C dev.c file analysis)
华为云ModelArts的使用教程(附详细图解)
I2C子系统之适配器的设备接口分析(i2c-dev.c文件分析)
补能的争议路线:快充会走向大一统吗?
90后开始攒钱植发,又一个IPO来了
CocosCreator事件派发使用
gatling 之性能测试
2022年全国CMMI认证补贴政策|昌旭咨询
Achieve animation effect through event binding
Redis master-slave replication