Skip to content

Instantly share code, notes, and snippets.

@yang20150702
Last active March 31, 2023 11:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yang20150702/87ac709f5895c17a1b8079532def2189 to your computer and use it in GitHub Desktop.
Save yang20150702/87ac709f5895c17a1b8079532def2189 to your computer and use it in GitHub Desktop.
gsoc-2022-dubbo-rust-final-report.md

Final Report of "Dubbo Rust language implementation (GSoC2022)"

Author: Yang Yang

Mentor: Liu Jun

Project Description

The goal of this project is to provide a Rust implementation of the Dubbo microservice framework, further expanding Dubbo multi-language ecosystem, and making Dubbo suitable for performance-sensitive applications.

Rust is a system level programming language, and its ownership is the foundation of safe concurrent programming; in addition, Rust follows the principles of C++ design: In general, C++ implementations obey the zero-overhead principle: What you don't use, you don't pay for. And further: What you do use, you couldn't hard code any better. Implementing the Dubbo framework based on Rust can greatly improve the performance of the Dubbo framework, while avoiding issues such as memory safety and concurrency safety.

The implementation of dubbo-rust is divided into two modules: RPC protocol implementation and service governance. The RPC protocol implementation module supports multiple RPC protocols as plugin. For service governance, mentor recommends using the latest xDS protocol to implement; since xDS protocol is being validated in other language implementations of Dubbo, this module is scheduled to be delayed.

Project Progress

dubbo-rust is based on hyper, prost, serde, tokio libraries. Now, dubbo-rust provides following capabilities:

  • dubbo-build: Generates dubbo stub code by compile IDL files. In addition, dubbo-build support protobuf and serde codecs
  • dubbo:
    • Supports multiple protocol plugin, currently supports triple protocol and is compatible with gRPC protocol; supports RPC asynchronous calls
    • The network connection layer of the triple protocol supports extensibility, currently supports TCP protocol, and will support Unix, TLS, UnixTLS and other protocols in the future
    • The client side of the triple protocol provides connection pooling capabilities, and will expand load balancing and service discovery capabilities in the future
    • The server side of the triple protocol: GratefulServer based on hyper and tokio

The implementation of dubbo-rust follows design principles of Dubbo: using MicroKernel and Plugin modes, all independent modules support extensibility.

Future Work

Future work is divided into two parts:

  • Refine the capabilities of the triple protocol layer, including general modules such as load balancing, service discovery, and interceptors
  • Understand the progress of the xDS protocol in the Dubbo community, implement the service governance of dubbo-rust based on the xDS protocol

Project Challenges

  1. Rust is a very good language with rich language features. During the project process, I have been learning much corresponding knowledge.
  2. Dubbo is an excellent microservice framework in the cloud native field. dubbo-rust need to combine the language features of rust to implement the core design of dubbo, and also need to redesign some modules.
  3. Because I have a full-time job, time management between open source work and full-time job is big challenge. In Google Summer of Code, I learn some skills to improve work efficiency: learn to ask questions, document first, design first, refine working time.

My Repositories and Commits

My Repositories

My dubbo-rust Clone Repo on Github

dubbo-rust-helloworld Repo on Github

My commits

Github Branch

PR: Connector and Resolver for TripleClient

PR: dubbo-build, use protoc to generate IDL code

PR: related with triple protocol PR35 , PR26 , PR21 , PR22

PR: Listener

PR: manage the lifecycle of dubbo-rust framework

PR: API of Protocol Module

Thanks

Thanks to Liu Jun and other students in the Dubbo community for their help. In the process of discussing and exchanging questions with them, I have deepened my understanding of the Dubbo framework and the Rust language.

A big thank you to my mentor, Liu Jun, he insisted on participating in the bi-weekly meeting despite his busy work, to understand the development progress of dubbo-rust, to answer the problems encountered, and to give me a lot of useful feedback and guidance.

While GSoC is coming to an end, it's a new beginning for my open source journey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment