当前位置:网站首页>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

边栏推荐
- TypeError: __ init__ () got an unexpected keyword argument ‘autocompletion‘
- AES简单介绍
- Guidelines and principles of did
- 为什么LTD独立站就是Web3.0网站!
- Pipeline detection of UAV Based on gazebo
- How can enterprises and developers take the lead in the outbreak of cloud native landing?
- Leetcode t40: combined sum II
- Leetcode t29: divide two numbers
- Advanced C language pointer (Part 2)
- C语言学生信息管理系统
猜你喜欢

【js逆向】md5加密参数破解

There are many problems in sewage treatment, and the automatic control system of pump station is solved in this way

TypeError: __init__() got an unexpected keyword argument ‘autocompletion‘

Centos7 shell script one click installation of JDK, Mongo, Kafka, FTP, PostgreSQL, PostGIS, pgrouting

The era of low threshold programmers is gone forever behind the sharp increase in the number of school recruitment for Internet companies

2022.2.15

Gateway-88

分享2022上半年我读过的7本书

What is 1cr0.5mo (H) material? 1cr0.5mo (H) tensile yield strength

你了解数据是如何存储的吗?(C整型和浮点型两类)
随机推荐
Redis publish subscription
What is the material of 16mo3 steel plate? What is the difference between 16mo3 and Q345R?
Intelligent water conservancy solution
用C语言编程:用公式计算:e≈1+1/1!+1/2! …+1/n!,精度为10-6
Principle and application of single chip microcomputer - off chip development
win7 pyinstaller打包exe 后报错 DLL load failed while importing _socket:参数错误
Yolov5 advanced 7 target tracking latest environment setup
华为机试真题专栏订阅指引
factory type_ Id:: create process resolution
Burpsuite -- brute force cracking of intruder
AES简单介绍
Vscode customize the color of each area
[no title] free test questions for constructor municipal direction general foundation (constructor) and theoretical test for constructor municipal direction general foundation (constructor) in 2022
【js逆向】md5加密参数破解
IT 技术电子书 收藏
基于Gazebo的无人机管道检测
Do you know how data is stored? (C integer and floating point)
你了解数据是如何存储的吗?(C整型和浮点型两类)
Foundation: 2 The essence of image
MATLAB小技巧(23)矩阵分析--模拟退火