dubbo frame design

After sorting out the content found in the document, the source has not been found. If you find the source, please leave a message, and I will indicate it here.



 


   The Dubbo framework design is divided into 10 layers, and the top Service layer is the interface layer for developers who actually want to use Dubbo to develop distributed services to implement business logic. The light blue background on the left in the figure is the interface used by the service consumer, the light green background on the right is the interface used by the service provider, and the interface located on the central axis is the interface used by both parties.


Below, combined with Dubbo's official documents, let's understand the design points of each level in the framework's layered architecture:

 

  1. Service interface layer (Service): This layer is related to the actual business logic, and the corresponding interface and implementation are designed according to the business of the service provider and service consumer
  2. Configuration layer (Config): External configuration interface, centered on ServiceConfig and ReferenceConfig, you can directly create new configuration classes, or you can generate configuration classes through spring parsing configuration.
  3. Service Proxy Layer (Proxy): Transparent proxy of service interface, generating client Stub and server Skeleton of service, with ServiceProxy as the center, and the extension interface is ProxyFactory.
  4. Service registration layer (Registry): Encapsulates the registration and discovery of service addresses, centered on the service URL, and the extended interfaces are RegistryFactory, Registry, and RegistryService. There may be no service registry, in which case the service provider directly exposes the service.
  5. Cluster layer (Cluster): Encapsulates routing and load balancing of multiple providers, and bridges the registration center. With Invoker as the center, the extended interfaces are Cluster, Directory, Router, and LoadBalance. Combining multiple service providers into one service provider realizes transparency to service consumers and only needs to interact with one service provider.
  6. Monitoring layer (Monitor): RPC call times and call time monitoring, with Statistics as the center, and the extended interfaces are MonitorFactory, Monitor and MonitorService.
  7. Remote calling layer (Protocol): Encapsulates RPC calls, centered on Invocation and Result, and extends the interface to Protocol, Invoker, and Exporter. Protocol is the service domain, it is the main function entry exposed and referenced by Invoker, and it is responsible for the life cycle management of Invoker. Invoker is the entity domain, it is the core model of Dubbo, other models rely on it, or convert to it, it represents an executable body, can initiate invoke calls to it, it may be a local implementation, or it may be Is a remote implementation, and possibly a cluster implementation.
  8. Information exchange layer (Exchange): Encapsulates the request response mode, synchronously to asynchronous, centered on Request and Response, and the extended interfaces are Exchanger, ExchangeChannel, ExchangeClient and ExchangeServer.
  9. Network transport layer (Transport): abstract mina and netty as unified interfaces, with Message as the center, and extended interfaces as Channel, Transporter, Client, Server, and Codec.
  10. Data serialization layer (Serialize): Some reusable tools, extended interfaces are Serialization, ObjectInput, ObjectOutput and ThreadPool.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326181051&siteId=291194637