Architecture
Dubbo Architecture

Specification of Node’s Role
| Node | Role Spec |
|---|---|
Provider | The provider exposes remote services |
Consumer | The consumer calls the remote services |
Registry | The registry is responsible for service discovery and configuration |
Monitor | The monitor counts the number of service invocations and time-consuming |
Container | The container manages the services’s lifetime |
Service relationship
Containeris responsible for launching, loading, and running the serviceProvider.Providerregisters its services toRegisterat the time it starts.Consumersubscribes the services it needs from theRegisterwhen it starts.Registerreturns theProviders list toConsumer, when it changes, theRegisterwill push the changed data toConsumerthrough long connection.Consumerselects one of theProviders based on soft load balancing algorithm and executes the invocation, if fails, it will choose anotherProvider.- Both
ConsumerandProviderwill count the number service invocations and time-consuming in memory, and send the statistics toMonitorevery minute.
Dubbo has the following features: Connectivity, Robustness, Scalability and Upgradeability.
Connectivity
Registeris responsible for the registration and search of service addresses, like directory services,ProviderandConsumeronly interact with the registry during startup, and the registry does not forward requests, so it is less stressed- ‘Monitor’ is responsible for counting the number of service invocations and time-consuming, the statistics will assembles in
Provider’s andConsumer’s memory first and then sent toMonitor - ‘Provider’ registers services to ‘Register’ and report time-consuming statistic(not include network overhead) to ‘Monitor’
- ‘Consumer’ gets a list of service provider addresses from
Registry, call the provider directly according to the LB algorithm, report the time-consuming statistic toMonitor, which includes network overhead - The connections between
Register,ProviderandConsumerare long connections,Moniteris an exception Registeris aware of the existence ofProviderthrough the long connection, whenProvidergets down,Registerwill push the event toConsumer- It doesn’t affect the already running instances of
ProviderandConsumereven all of theRegisterandMonitorget down, sinceConsumergot a cache ofProviders list RegisterandMonitorare optional,Consumercan connectProviderdirectly
Robustness
Monitor’s downtime doesn’t affect the usage, only lose some sampling data- When the DB server goes down,
Registercan return serviceProviders list toConsumerby checking its cache, but newProvidercannot register any services Registeris a peer cluster, it will automatically switch to another when any instance goes down- Even all
Register’s instances go down,ProviderandConsumercan still conmunicate by checking their local cache - Service
Providers are stateless, one instance’s downtime doesn’t affect the usage - After all the
Providers of one service go down,Consumercan not use that service, and infinitely reconnect to wait for serviceProviderto recover
Scalability
Registeris a peer cluster that can dynamically increases its instances, all clients will automatically discover the new instances.Provideris stateless, it can dynamically increases the deployment instances, and the registry will push the new service provider information to theConsumer.
Upgradeablity
When the service cluster is further expanded and the IT governance structure is further upgraded, dynamic deployment is needed, and the current distributed service architecture will not bring resistance. Here is a possible future architecture:

Specification of Node’s Role
| Node | Role Spec |
|---|---|
Deployer | Local proxy for automatic services deployment |
Repository | The repository is used to store application packages |
Scheduler | The scheduler automatically increases or decreases service providers based on the access pressure |
Admin | Unified management console |
Registry | the registry is responsible for service discovery and configuration |
Monitor | The monitor counts the service call times and time-consuming |
Last modified December 22, 2020: clean up website (6e41905afa)
