Dubbo入门简介

Dubbo入门简介

1、Dubbo简介

(1)官网dubbo.io

       http://dubbo.apache.org/en-us/

Dubbo入门简介_第1张图片

(2)国产优秀的开源框架

       Alibaba开发的开源框架

(3)诸如京东、当当等都在使用

       当当网在Dubbo基础之上开发了DubboX框架

(4)最大程度进行解耦,降低系统耦合性

(5)生产者/消费者模式

(6)zk注册中心,admin监控中心,协议支持

 

2、Dubbo架构图

Dubbo入门简介_第2张图片

Specification of Node's Role(节点角色的规范)

Node

Role Spec

Provider

The provider exposes remote services

Consumer

The consumer calls the remote services

Registry

The registry is responsible for service discovery and configuration

Monitor

The monitor counts the number of service invocations and time-consuming

Container

The container manages the services's lifetime

 

Service relationship(服务关系)

  1. Container is responsible for launching, loading, and running the service Provider.
  2. Provider registers its services to Register at the time it starts.
  3. Consumer subscribes the services it needs from the Register when it starts.
  4. Register returns the Providers list to Consumer, when it changes, the Register will push the changed data to Consumer through long connection.
  5. Consumer selects one of the Providers based on soft load balancing algorithm and executes the invocation, if fails, it will choose another Provider.
  6. Both Consumer and Provider will count the number service invocations and time-consuming in memory, and send the statistics to Monitor every minute.

Dubbo has the following features: Connectivity, Robustness, Scalability and Upgradeability.

Connectivity(连接性)

  • Register is responsible for the registration and search of service addresses, like directory services, Provider and Consumer only interact with the registry during startup, and the registry does not forward requests, so it is less stressed
  • 'Monitor' is responsible for counting the number of service invocations and time-consuming, the statistics will assembles in Provider's and Consumer's memory first and then sent to Monitor
  • 'Provider' registers services to 'Register' and report time-consuming statistic(not include network overhead) to 'Monitor'
  • 'Consumer' gets a list of service provider addresses from Registry, call the provider directly according to the LB algorithm, report the time-consuming statistic to Monitor, which includes network overhead
  • The connections between RegisterProvider and Consumer are long connections, Moniter is an exception
  • Register is aware of the existence of Provider through the long connection, when Provider gets down, Provider will push the event to Consumer
  • It doesn't affect the already running instances of Provider and Consumer even all of the Registerand Monitor get down, since Consumer got a cache of Providers list
  • Register and Monitor are optional, Consumer can connect Provider directly

Robustness(鲁棒性 or 健壮性)

  • Monitor's downtime doesn't affect the usage, only lose some sampling data
  • When the DB server goes down, Register can return service Providers list to Consumer by checking its cache, but new Provider cannot regiter any services
  • Register is a peer cluster, it will automatically switch to another when any instance goes down
  • Even all Register's instances go down, Provider and Consumer can still conmunicate by checking their local cache
  • Service Providers are stateless, one instance's downtime doesn't affect the usage
  • After all the Providers of one service go down, Consumer can not use the that service, and infinitely reconnect to wait for service Provider to recover

Scalability(可扩展性)

  • Register is a peer cluster that can dynamically increases its instances, all clients will automatically discover the new instances.
  • Provider is stateless, it can dynamically increases the deployment instances, and the registry will push the new service provider information to the Consumer.

Upgradeablity(可升级性)

When the service cluster is further expanded and the IT governance structure is further upgraded, dynamic deployment is needed, and the current distributed service architecture will not bring resistance. Here is a possible future architecture:

 

Specification of Node's Role(节点角色的规范)

Node

Role Spec

Deployer

Local proxy for automatic services deployment

Repository

The repository is used to store application packages

Scheduler

The scheduler automatically increases or decreases service providers based on the access pressure

Admin

Unified management console

Registry

the registry is responsible for service discovery and configuration

Monitor

The monitor counts the service call times and time-consuming

 

3、Dubbo读法

Dubbo入门简介_第3张图片

4、Dubbo版本查看

Dubbo入门简介_第4张图片

从图中可以发现2.5.3使用的人最多,是最稳定的版本;

2012年Dubbo团队就停止了开发,直到2017年开始又重新开始Dubbo版本的迭代。

你可能感兴趣的:(Dubbo)