Why Dubbo May Just Become the Best Service Development Framework for Connecting Heterogeneous Microservice Systems

Transparent Service Development Framework Oriented to Interface Proxy

public interface GreetingsService {
String sayHi(String name);
}
// 和调用本地服务一样,完全透明。
@Reference
private GreetingService greetingService;
public void doSayHello(String name) {
greetingService.sayHi("Hello world!");
}

The Challenges of Homogeneous and Heterogeneous Microservice Systems

Multi-Protocol and Multi-Registry Mechanism in the Dubbo System

Multi-Protocol

<dubbo:service interface="org.apache.dubbo.samples.basic.api.DemoService1" protocol="dubbo"/>
<dubbo:service interface="org.apache.dubbo.samples.basic.api.DemoService2" protocol="dubbo"/>
<dubbo:service interface="org.apache.dubbo.samples.basic.api.DemoService3" protocol="grpc"/>
<dubbo:service interface="org.apache.dubbo.samples.basic.api.DemoService4" protocol="grpc"/>
<dubbo:service interface="org.apache.dubbo.samples.basic.api.DemoService0" protocol="dubbo, grpc"/>
<dubbo:reference protocol="dubbo" interface="org.apache.dubbo.samples.basic.api.DemoService1"/>
<dubbo:reference protocol="dubbo" interface="org.apache.dubbo.samples.basic.api.DemoService2"/>
<dubbo:reference protocol="grpc" interface="org.apache.dubbo.samples.basic.api.DemoService0"/>
<dubbo:reference protocol="grpc" interface="org.apache.dubbo.samples.basic.api.DemoService3"/>                                                                                     <dubbo:reference protocol="grpc" interface="org.apache.dubbo.samples.basic.api.DemoService4"/><dubbo:reference protocol="dubbo" interface="org.apache.dubbo.samples.basic.api.DemoService0"/>

Protocols Supported by Dubbo

Issues That Can Be Solved in Multi-protocol Mode

Multi-Registry

<dubbo:registry id="beijingRegistry" address="zookeeper://{zookeeper.address1}" default="false"/>                                                                           <dubbo:registry id="shanghaiRegistry" address="zookeeper://${zookeeper.address2}" />

<dubbo:service interface="org.apache.dubbo.samples.multi.registry.api.HelloService" ref="helloService" registry="shanghaiRegistry,beijingRegistry"/>
<dubbo:service interface="org.apache.dubbo.samples.multi.registry.api.DemoService" ref="demoService" registry="shanghaiRegistry,beijingRegistry"/>
<dubbo:registry id="beijingRegistry" address="zookeeper://{zookeeper.address1}" default="false" preferred="true" weight="100"/>                                                                                         <dubbo:registry id="shanghaiRegistry" address="zookeeper://${zookeeper.address2}" default="true" weight="20"/><dubbo:reference interface="org.apache.dubbo.samples.multi.registry.api.DemoService"/><dubbo:reference  interface="org.apache.dubbo.samples.multi.registry.api.DemoService" registry="beijingRegistry, shanghaiRegistry"/><dubbo:reference interface="org.apache.dubbo.samples.multi.registry.api.HelloService" registry="beijingRegistry"/><dubbo:reference interface="org.apache.dubbo.samples.multi.registry.api.HelloService" registry="shanghaiRegistry,shanghaiRegistry"/>

Dubbo’s Support for Heterogeneous Registry Clusters

Traffic Scheduling Caused by Multiple Subscriptions

<!-- 来自 preferred="true" 注册中心的地址将被优先选择,只有该中心无可用地址时才 Fallback 到其他注册中心 -->
<dubbo:registry address="zookeeper://${zookeeper.address1}" preferred="true" />
<!-- 选址时会和流量中的 zone key 做匹配,流量会优先派发到相同 zone 的地址 -->
<dubbo:registry address="zookeeper://${zookeeper.address1}" zone="beijing" />
<!-- 来自北京和上海集群的地址,将以 10:1 的比例来分配流量 -->
<dubbo:registry id="beijing" address="zookeeper://${zookeeper.address1}" weight="100" />
<dubbo:registry id="shanghai" address="zookeeper://${zookeeper.address2}" weight="10" />

Scenarios of the Multi-Registry Solution

Connect Heterogeneous Microservice Systems with Dubbo

Protocol Migration in the Dubbo System (Coexistence)

Migration from the Spring Cloud System to Dubbo System (Coexistence)

<dubbo:reference interface ="xxx.SpringService" protocol="rest"/>
<dubbo:service interface="xxx.NewService" protocol="rest,dubbo"/>

Migration from an On-Premises System to a Dubbo System (Coexistence)

Conclusion and Prospects

Original Source:

--

--

--

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

OSS Open-Source Tool OSSUTIL: Upload Performance Tuning

How to Speed up Your Site in Cheap Hosting

VueJS dev serve with reverse proxy

Week 3 CS371p Blog

Prosper`s mainnet guide

Notes, That will get you Terraform Certification!!

The Evolution and Real-World Applications of Function Compute

Alibaba Cloud Tablestore: A Case Study on Backing up a Massive Volume of Structured Data

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alibaba Cloud

Alibaba Cloud

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com

More from Medium

Get started with OpenSearch — The really quick guide.

CI/CD Pipeline for API using WSO2 API controller and Jenkins

Mock S3 service for local development

Produce and consume messages from a Kafka topic using docker