Dubbo-go is the Go language implementation of Apache Dubbo, fully adhering to Apache Dubbo’s design principles and goals, and serves as an excellent microservices development framework in the Go language domain. Dubbo-go offers:
Below is the overall architecture diagram of dubbo-go:
Dubbo-go generally follows a framework core + plugin
design concept. The left side, framework core
, defines some core concepts of dubbo-go as a microservice framework, while the right side, plugin
, provides extension implementations of core concepts.
The framework core
can be divided into four levels, from top to bottom:
API Layer: Supports service contract definitions based on IDL and interface/struct, balancing cross-language and usability needs; supports microservice configuration based on pure YAML files; provides synchronous, asynchronous, unary, and streaming RPC communication and encoding models.
Service Governance Layer: Built-in multidimensional service governance capabilities ensure meeting core requirements for microservice development and cluster governance. This includes service discovery, load balancing, observability metrics, traffic management, and tracing.
RPC Protocol Layer: The core RPC protocol implemented by dubbo-go is the triple protocol, which works over HTTP/1/2 (supports direct access via CURL) and is compatible with gRPC. Dubbo-go also supports multi-protocol service publishing.
Transport Layer: Supports HTTP/1/2 and TCP transport layers, balancing performance and generality, while supporting various serialization methods.
The plugin
system greatly enriches dubbo-go’s functionality and ecosystem, with numerous built-in extension implementations provided by the community. Developers can easily add extension implementations as needed. Here are some typical plugin definitions:
Below is the core components and their relationships from the perspective of the kernel source:
Based on the Dubbo-defined triple protocol, you can easily write browser and gRPC compatible RPC services that run simultaneously on HTTP/1 and HTTP/2. As part of the multi-language RPC system of Apache Dubbo, dubbo-go offers a complete implementation of the triple protocol.
For more details on cross-language or cross-product interoperability of dubbo-go, please refer to the following links:
In addition to the triple protocol, dubbo-go supports more RPC protocols and serialization methods:
Protocol | Protocol Name (for configuration) | Serialization Method | Default Serialization Method |
---|---|---|---|
Triple (Recommended) | tri | pb/json/custom | pb |
Dubbo | dubbo | hessian2 | hessian2 |
jsonRPC | jsonrpc | json | json |
REST | rest | json | json |
As shown below, a filter is an AOP-like request interception mechanism. Every RPC request will be intercepted by the filter.
Core capabilities of dubbo-go, such as timeout settings, access logs, and metrics, are all implemented through built-in filters.
Dubbo-go provides comprehensive service governance capabilities, including service discovery, observability, full-link tracing, and traffic control. You can use dubbo-go to develop and manage microservice clusters and achieve interoperability with other language systems in Apache Dubbo.
The types of registries supported by dubbo-go are as follows. Please refer to the usage tutorial Service Discovery for specific configuration methods:
Registry | Registry Name (for configuration) |
---|---|
Zookeeper | zookeeper |
Nacos | nacos |
Etcd | etcd |
Polaris | polaris |
Dubbo-go’s observable metric collection follows the metrics specification defined by Apache Dubbo. The most common method is to export to Prometheus and visualize via Grafana.
For specific enabling methods, please refer to the usage manual Observability.
Dubbo-go supports full-link tracing systems like Zipkin, Jaeger, and Skywalking via OpenTelemetry.
For specific enabling methods, please refer to the usage manual Tracing.
The traffic governance rules implemented by dubbo-go fully comply with Dubbo framework-designed traffic governance capabilities. More details can be found through the following links: