当前位置:网站首页>Nacos - service discovery
Nacos - service discovery
2022-07-01 08:40:00 【SXHENIGA】
Translation source of notes : Dark horse Nacos
One 、 Monomer architecture and microservices
1、 Monomer architecture
Use the same database for all functional modules , meanwhile , It also provides API perhaps UI Access to the Web Module etc. , Eventually, it will be packaged and deployed as a single application , This method deploys all functions in one Web The system running in the container is called monomer architecture
advantage | |
1 | High development efficiency |
2 | Easy to test |
3 | Easy to deploy |
shortcoming | |
1 | The complexity is getting higher , The maintainability of the giant sword is getting worse |
2 | The falling speed of the version gradually slows down |
3 | Hinder technological innovation |
4 | Can't scale on demand |
2、 Microservices
Each business module uses independent services to complete , This microservice architecture pattern also affects the relationship between applications and databases , Unlike traditional methods, multiple business modules share a database , Microservice architecture each service has its own database .
benefits | |
1 | Divide and rule , Single responsibility ; Easy to develop 、 Understanding and maintenance 、 Facilitate the splitting and management of the team ; |
2 | Telescopic ; It can scale the specified service separately ; |
3 | Local modification , Easy to replace , Easy to deploy , Conducive to continuous integration and rapid iteration |
4 | Not limited to any technology stack |
Two 、 Service discovery
In microservices , Services collaborate to achieve business goals . Remote calls between services are also required in microservices , Then you need to know the network location of the service 【IP And port number 】, Then you need to achieve the following .
①、 You need to report your network location to the service discovery center when each service is started .
②、 The service discovery client will periodically synchronize the service registry from the service discovery center , And cache on the client
③、 When a service needs to be requested , The service instance passes through the registry , Locate the target service network address . If the target service has multiple network addresses , Then the load balancing algorithm is used to select one from multiple service instances , Then make a request .
summary : In microservice , Because the network address of the service running instance is constantly changing , Dynamic changes in the number of service instances , Therefore, a fixed configuration file cannot be used to record the provider's network address , Dynamic service discovery mechanism must be used to realize mutual perception between microservices . Each service instance will report its own network address , In this way, the service center forms a complete service registry , Each service instance will obtain the network address of the target service through the service discovery center , So as to realize the mechanism of service discovery .
3、 ... and 、 Comparison between mainstream service discovery and configuration center
Comparison items | Nacos | Eureka | Consul | Zookeeper |
Agreement of conformity | Support AP and CP Model | AP Model | CP Model | CP Model |
health examination | TCP/HTTP/MYSQL/Client Beat | Client Beat | TCP/HTTP/gRPC/Cmd | Keep Alive |
Load balancing strategy | The weight /metadata/Selector | Ribbon | Fabil | - |
Avalanche protection | Yes | Yes | nothing | nothing |
Auto logout instance | Support | Support | I won't support it | Support |
access protocol | HTTP/DNS | HTTP | HTTP/DNS | TCP |
Monitor support | Support | Support | Support | Support |
Multi-data center | Support | Support | Support | I won't support it |
Sync across registries | Support | I won't support it | Support | I won't support it |
SpringCloud Integrate | Support | Support | Support | I won't support it |
Dubbo Integrate | Support | I won't support it | I won't support it | Support |
k8s Integrate | Support | I won't support it | Support | I won't support it |
Four 、Spring Cloud Service collaboration process
边栏推荐
- Leetcode t31: prochain arrangement
- Glitch free clock switching technology
- Computer tips
- 挖财打新股安全吗
- V79.01 Hongmeng kernel source code analysis (user mode locking) | how to use the fast lock futex (Part 1) | hundreds of blogs analyze the openharmony source code
- 2022 ordinary scaffolder (special type of construction work) examination question bank and the latest analysis of ordinary scaffolder (special type of construction work)
- 机动目标跟踪——当前统计模型(CS模型)扩展卡尔曼滤波/无迹卡尔曼滤波 matlab实现
- The era of low threshold programmers is gone forever behind the sharp increase in the number of school recruitment for Internet companies
- 长安链同步节点配置与启动
- VSYNC+三重缓存机制+Choreographer
猜你喜欢
1. Connection between Jetson and camera
截图小妙招
【C】 Summary of wrong questions in winter vacation
It is designed with high bandwidth, which is almost processed into an open circuit?
Computer tips
Redis publish subscription
Pipeline detection of UAV Based on gazebo
AVL树的理解和实现
Glitch free clock switching technology
MATLAB小技巧(16)矩阵特征向量特征值求解一致性验证--层次分析
随机推荐
Maneuvering target tracking -- current statistical model (CS model) extended Kalman filter / unscented Kalman filter matlab implementation
Intelligent water conservancy solution
Memory size end
动态代理
串口转WIFI模块通信
DID的使用指南,原理
There are many problems in sewage treatment, and the automatic control system of pump station is solved in this way
win7 pyinstaller打包exe 后报错 DLL load failed while importing _socket:参数错误
SPL-介绍(一)
Introduction to R language
Luogu p3799 demon dream stick
如何招到适合自己店铺的淘宝主播
Leetcode t31: prochain arrangement
电脑小技巧
SPL-安装与基本使用(二)
Gateway-88
What is the material of 15CrMoR, mechanical properties and chemical analysis of 15CrMoR
I would like to know the process of stock registration and account opening by mobile phone? In addition, is it safe to open a mobile account?
Intelligent constant pressure irrigation system
长安链同步节点配置与启动