apache / dubbo-go

Go Implementation For Apache Dubbo .
https://dubbo.apache.org/
Apache License 2.0
4.69k stars 917 forks source link

Revisit the end-user programming API #2265

Open chickenlj opened 1 year ago

chickenlj commented 1 year ago

总体来说,这里涉及到一个关于 Dubbo-go 总体易用性提升大议题,编程 API 相关是其中非常重要的一部分。

作为一款服务开发框架,使用者依赖 Dubbo-go 提供的 API 进行服务定义、发布和调用,因此,我们需要确保 Dubbo-go 的 API 设计足够清晰、易用且满足所有功能诉求,在遵循 Dubbo 总体风格的同时符合 Go 语言主流编码风格。

当前 Dubbo-go API 中的一些问题,与其最开始大量借鉴了 Dubbo Java 语言版本有一定的关系:在过去相当长的一段时间内,Dubbo-go 项目的核心定位实现是与 Java 体系的互通,这是 Dubbo-go 和快速发展的基础,同时为了也为项目带来了太多 Java 语言风格的绑定。

在 Dubbo 全面升级为跨语言微服务框架的背景下,社区开始投入很大精力从顶层设计 Dubbo,包括 Dubbo3 的核心架构与特性,这些变化可以从 Dubbo 的新版官网明确感受到(纵使我们的官网及文档距离终态目标还有很远)。统一的上层架构为我们提供了跨语言的设计,同时为每种语言 SDK 实现提供了方向指导,确保了 Dubbo 体系的连续性。

因此,我们应该以 Dubbo 的总体设计为基础,重新 review Dubbo-go 中的部分功能设计与实现,确保 Dubbo 在 go 体系下的独有特色与核心竞争力,取代最开始 “与 Dubbo Java 互通” 的核心定位。本 Issue 要讨论的内容包括但不限于以下内容:

Generally speaking, this involves a big topic about improving the overall usability of Dubbo-go, and programming API is a very important part of it.

As a service development framework, users rely on the API provided by Dubbo-go to define, publish and call services. Therefore, we need to ensure that the API design of Dubbo-go is clear enough, easy to use and meets all functional demands. Following Dubbo's overall The style conforms to the mainstream coding style of Go language.

Some problems in the current Dubbo-go API have a certain relationship with the fact that it borrowed heavily from the Dubbo Java language version at the beginning: For a long period of time in the past, the core positioning of the Dubbo-go project was the intercommunication with the Java system. It is the foundation of Dubbo-go and rapid development, and it also brings too many Java language-style bindings to the project.

In the context of Dubbo's comprehensive upgrade to a cross-language microservice framework, the community began to invest a lot of energy in designing Dubbo from the top level, including the core architecture and features of Dubbo3. These changes can be clearly felt from the new version of Dubbo's official website (even though our official website and Documentation is still far from the final state goal). The unified upper-level architecture provides us with a cross-language design, and at the same time provides direction guidance for the implementation of each language SDK, ensuring the continuity of the Dubbo system.

Therefore, based on Dubbo's overall design, we should re-review some of the function design and implementation in Dubbo-go to ensure Dubbo's unique features and core competitiveness under the go system, replacing the original "interoperability with Dubbo Java" core positioning. The topics to be discussed in this Issue include but are not limited to the following:

guoche21 commented 1 year ago

你好,很高兴了解到 GSoC!我是一名毕业不久、工作经验接近一年的社会员工,想要参与到当前这个 issue 当中。

目前在基础系统组,主要工作内容有:

  1. 优化和重构基础的服务框架流程
  2. 为业务方提供 api,尽可能制定通用的接口协议
  3. 有一定的 go 开发经验

感觉 chickenlj 对该 issue 的说明已经很到位了😀

以下是我结合工作过程中使用 Go 开发微服务的一些想法,对提升 dubbo-go 易用性的理解:

  1. 使用 protoc 工具生成的 api 要针对 go 本身的语言特性,符合 go 的编程风格和 dubbo 的实现规范
  2. api 相关:对于服务的设置、自定义中间件的插入使用等要足够简单明确
  3. 配置相关:尽量不要重复配置,可以根据不同场景使用不同配置

希望这次 GSoC 能参与到该 issue 中,为开源项目贡献一点力量,同时提升自己的技能与视野,谢谢!

个人联系方式: email: guoche21@gmail.com wechat: Axitaka21