Dubbo (two) Dubbo basics

1. What is Dubbo
Dubbo Alibaba open source is a high performance excellent service framework, so that the application can realize output and input functions and services through the RPC performance, it can be seamlessly integrated with the Spring Framework.
Dubbo is a high performance, lightweight open-source Java RPC framework, which provides three core capabilities: an interface for remote method invocation, intelligent fault tolerance and load balancing, and automatic registration and service discovery.
2, background generated Dubbo
Here Insert Picture Description principle 3.Dubbo architecture
Here Insert Picture Descriptioninside that picture of the details of
Here Insert Picture Description the node Description
Here Insert Picture Description
call relationship Description

服务容器负责启动,加载,运行服务提供者。
服务提供者在启动时,向注册中心注册自己提供的服务。
服务消费者在启动时,向注册中心订阅自己所需的服务。
注册中心返回服务提供者地址列表给消费者,如果有变更,注册中心将基于长连接推送变更数据给消费者。
服务消费者,从提供者地址列表中,基于软负载均衡算法,选一台提供者进行调用,如果调用失败,再选另一台调用。
服务消费者和提供者,在内存中累计调用次数和调用时间,定时每分钟发送一次统计数据到监控中心。

Dubbo architecture has the following characteristics, namely communication, robustness, flexibility, and upgradeability to future architectures.
Connectivity

注册中心负责服务地址的注册与查找,相当于目录服务,服务提供者和消费者只在启动时与注册中心交互,注册中心不转发请求,压力较小
监控中心负责统计各服务调用次数,调用时间等,统计先在内存汇总后每分钟一次发送到监控中心服务器,并以报表展示
服务提供者向注册中心注册其提供的服务,并汇报调用时间到监控中心,此时间不包含网络开销
服务消费者向注册中心获取服务提供者地址列表,并根据负载算法直接调用提供者,同时汇报调用时间到监控中心,此时间包含网络开销
注册中心,服务提供者,服务消费者三者之间均为长连接,监控中心除外
注册中心通过长连接感知服务提供者的存在,服务提供者宕机,注册中心将立即推送事件通知消费者
注册中心和监控中心全部宕机,不影响已运行的提供者和消费者,消费者在本地缓存了提供者列表
注册中心和监控中心都是可选的,服务消费者可以直连服务提供者

Robustness

监控中心宕掉不影响使用,只是丢失部分采样数据
数据库宕掉后,注册中心仍能通过缓存提供服务列表查询,但不能注册新服务
注册中心对等集群,任意一台宕掉后,将自动切换到另一台
注册中心全部宕掉后,服务提供者和服务消费者仍能通过本地缓存通讯
服务提供者无状态,任意一台宕掉后,不影响使用
服务提供者全部宕掉后,服务消费者应用将无法使用,并无限次重连等待服务提供者恢复

Flexibility

注册中心为对等集群,可动态增加机器部署实例,所有客户端将自动发现新的注册中心
服务提供者无状态,可动态增加机器部署实例,注册中心将推送新的服务提供者信息给消费者

Scalability

When the cluster service further expand the scale to drive IT governance structure further escalation, the need to achieve dynamic deployment, conduct flow calculation, the existing distributed service architecture will not bring resistance. The figure is a possible future architecture:
Here Insert Picture DescriptionNode Role Description

Here Insert Picture Description

4、Dubbo的优缺点
Here Insert Picture DescriptionDubbo支持Dubbo、rmi、hessian、http、webservice
thrift、redis等多种协议,但是Dubbo官网推荐我们使用Dubbo协议的。
1、SpringBoot是否可以整合Dubbo框架
整合遇到坑 基于SpringBoot2.0以上
Springboot 整合Dubbo例子都是1.5版本完全是不一样,命名、依赖的jar 书写方式都发生了改变。
SpringCloud项目feign客户端基础依赖方式是实现重构项目
为什么放弃Dubbo,而采用SpringCloud框架
相同点:都可以实现rpc远程远程调用框架,都可以实现服务治理和发现
不同点:
从框架架构层面
Dubbo 内部实现功能没有SpringCould(全家桶)更加强大,目前来说SpringCloud比较完善微服务框架。
因为Dubbo核心只是实现服务治理,缺少一些分布式解决方案的整合(比如分布式配置中心,消息总线,链路等,网关),需要整合其他一些分布式解决方案框架。
从版本更新迭代
Dubbo目前迭代的速度没有springCould更新迭代快,而且在springCould2.0整合springboot功能变得越来越完善和稳定。
从框架开发背景
Dubbo 的开发背景是阿里巴巴集团,阿里提供非常多优秀的开源框架,但是springcloud开发背景spring家族。
spring family is designed to provide enterprise-class open source framework, but also in China, the world spring or application of the product more widely.
Concluded: If learn Dubbo, then, to learn from other distributed solutions need to assemble their own, but if learning SpringCloud, it has been common to the whole distributed solutions are integrated better.

Published 45 original articles · won praise 7 · views 931

Guess you like

Origin blog.csdn.net/qq_42222342/article/details/103747114