Understanding the Layered Architecture of the Dubbo Distributed Service Framework
This article explains Dubbo’s ten‑layer architecture, detailing each layer’s responsibilities, the service definition, registration, monitoring, communication protocols, and the package structure that together enable a flexible, decoupled distributed RPC system for backend development.
Dubbo is Alibaba’s open‑source distributed service framework that adopts a layered architecture to achieve loose coupling between components. The framework distinguishes two roles—Provider and Consumer—based on a simple service model where one side provides services and the other consumes them.
Overall Architecture
The overall architecture consists of ten layers, with the topmost Service layer exposing business interfaces for developers. The left‑hand side of the diagram shows consumer‑side interfaces, the right‑hand side shows provider‑side interfaces, and the central axis contains shared interfaces.
Layer Details
Service Interface Layer – defines business‑related interfaces and implementations.
Config Layer – external configuration interfaces centered on ServiceConfig and ReferenceConfig.
Proxy Layer – transparent proxy generating client Stubs and server Skeletons.
Registry Layer – service address registration and discovery (RegistryFactory, Registry, RegistryService).
Cluster Layer – routing and load‑balancing across multiple providers (Cluster, Directory, Router, LoadBalance).
Monitor Layer – RPC call count and latency monitoring (Statistics, MonitorFactory, Monitor).
Protocol Layer – core RPC invocation handling (Protocol, Invoker, Exporter) and lifecycle management.
Exchange Layer – request/response pattern abstraction (Request, Response, Exchanger, ExchangeChannel, ExchangeClient, ExchangeServer).
Transport Layer – abstracts Mina/Netty transport (Message, Channel, Transporter, Client, Server, Codec).
Serialize Layer – serialization utilities (Serialization, ObjectInput, ObjectOutput, ThreadPool).
The diagram shows how Dubbo provides distinct interfaces for providers and consumers across these layers, forming a complete service ecosystem.
Core Concepts
Service Definition – providers implement services, consumers invoke them.
Service Registration – providers publish services to a registry (e.g., Zookeeper, Multicast, Redis, Simple) and consumers subscribe to obtain usable services.
Service Monitoring – both sides monitor call status to improve quality.
Remote Communication & Information Exchange – Dubbo supports multiple transport frameworks such as Mina, Netty, and Grizzly.
Service Call Flow
Provider publishes service to the registry.
Consumer subscribes to the service from the registry.
Consumer invokes the registered service.
Additional sequence diagrams illustrate service registration/unregistration and subscription/cancellation processes.
Protocol Support
Dubbo supports various protocols, including Dubbo, Hessian, HTTP, RMI, WebService, Thrift, Memcached, and Redis. Choosing the appropriate protocol depends on factors such as firewall restrictions and service quality requirements.
Package Structure
Dubbo’s modules are organized into packages such as dubbo-common, dubbo-remoting, dubbo-rpc, dubbo-cluster, dubbo-registry, dubbo-monitor, dubbo-config, and dubbo-container, each handling specific concerns like utilities, remote communication, clustering, registration, monitoring, configuration APIs, and standalone container execution.
Source: 简单之美 (http://shiyanjun.cn/archives/325.html)
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Architect
Professional architect sharing high‑quality architecture insights. Topics include high‑availability, high‑performance, high‑stability architectures, big data, machine learning, Java, system and distributed architecture, AI, and practical large‑scale architecture case studies. Open to ideas‑driven architects who enjoy sharing and learning.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
