当前位置:网站首页>[微服务]认识微服务
[微服务]认识微服务
2022-06-26 23:09:00 【fate _zore】
认识微服务
单体架构:将业务的所有功能集中在一个项目中开发,打成一个包部署。
**优点:**架构简单,部署成本低
**缺点:**耦合度高(维护困难、升级困难)

分布式架构:根据业务功能对系统做拆分,每个业务功能模块作为独立项目开发,称为一个服务。
**优点:**降低服务耦合,有利于服务升级和拓展
**缺点:**服务调用关系错综复杂

分布式架构虽然降低了服务耦合,但是服务拆分时也有很多问题需要思考:
- 服务拆分的粒度如何界定?
- 服务之间如何实现远程调用?
- 服务的调用关系如何管理?
- 服务健康状态如何感知?
- 服务集群地址如何维护?
人们需要制定一套行之有效的标准来约束分布式架构。
微服务
微服务的架构特征:
- 单一职责:微服务拆分粒度更小,每一个服务都对应唯一的业务能力,做到单一职责
- 自治:团队独立、技术独立、数据独立,独立部署和交付
- 面向服务:服务提供统一标准的接口,与语言和技术无关
- 隔离性强:服务调用做好隔离、容错、降级,避免出现级联问题

微服务的上述特性其实是在给分布式架构制定一个标准,进一步降低服务之间的耦合度,提供服务的独立性和灵活性。做到高内聚,低耦合。
因此,可以认为微服务是一种经过良好架构设计的分布式架构方案 。
其中在 Java 领域最引人注目的就是 SpringCloud 提供的方案了。
微服务结构
微服务这种方案需要技术框架来落地,全球的互联网公司都在积极尝试自己的微服务落地技术,国内最知名的就是SpringCould和阿里的Dubbo
微服务技术对比
| Dobbo | springCloud | springCloudAlibaba | |
|---|---|---|---|
| 注册中心 | zookeeper,Redis | Eureka,Consul | Nacos,Eureka |
| 服务远程调用 | Dubbo协议 | Feign(http协议) | Dubbo,Feign |
| 配置中心 | null | SpringCloudConfig | SpringCloudConfig,Nacos |
| 服务网关 | null | SpringCloudGateway,Zuul | SpringCloudGateway,Zuul |
| 服务监控和保护 | dubbo-admin,功能弱 | Hystrix | Sentinel |

边栏推荐
- [machine learning] - Introduction to vernacular and explanation of terms
- PHP代码审计系列(一) 基础:方法、思路、流程
- 300题 第三讲 向量组
- Are there any risks for the top ten securities companies to register and open accounts? Is it safe?
- Electronic Society C language level 1 31. Calculate line segment length
- Unity初学者肯定能用得上的50个小技巧
- 分享三種在Excel錶格中自動求和的方法
- Development and learning route of golang language
- npm 命令提示Error: EACCES: permission denied
- WP collection plug-in tutorial no thanks for WordPress collection of rules
猜你喜欢

DAST black box vulnerability scanner part 5: vulnerability scanning engine and service capability

UnityEditor编辑器扩展-表格功能

开放世界机甲游戏-Phantom Galaxies

Three solutions for improving embedded software development environment

Flashtext, a data cleaning tool, has directly increased the efficiency by dozens of times
![How to download on selenium computer -selenium download and installation graphic tutorial [ultra detailed]](/img/ec/1c324dcf38d07742a139aac2bab02e.png)
How to download on selenium computer -selenium download and installation graphic tutorial [ultra detailed]

golang语言的开发学习路线
![[Old Wei makes machines] issue 090: keyboard? host? Full function keyboard host!](/img/78/ece6da9a26c9d93988dac30ce93f99.png)
[Old Wei makes machines] issue 090: keyboard? host? Full function keyboard host!

WP collection plug-in tutorial no thanks for WordPress collection of rules

Operations research says that in issue 66, Behrman also has "speech phobia"?
随机推荐
想买股票请问在券商公司的哪里开户佣金低更安全
树莓派初步使用
Is it safe to open an account and speculate in stocks on the mobile phone? Is it safe to open an account and speculate in stocks on the Internet
Is the low commission free account opening channel safe?
Learun low code OA system construction platform
为什么我不推荐去SAP培训机构参加培训?
固有色和环境色
Operations research says that in issue 66, Behrman also has "speech phobia"?
UnityEditor編輯器擴展-錶格功能
【710. 黑名单中的随机数】
Flashtext, a data cleaning tool, has directly increased the efficiency by dozens of times
【混合编程jni 】第十一篇之JNA详情
分享三种在Excel表格中自动求和的方法
Electronic Society C language level 1 31. Calculate line segment length
ASP. Net core create MVC project upload file (buffer mode)
C语言:简单计算器多次使用代码实现
ubuntu上安装mysql
NPM command prompt error: eacces: permission denied
Wechat applet is authorized to log in wx getUserProfile
12 color ring three primary colors