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 |
Container
is responsible for launching, loading, and running the service Provider
.Provider
registers its services to Register
at the time it starts.Consumer
subscribes the services it needs from the Register
when it starts.Register
returns the Provider
s list to Consumer
, when it changes, the Register
will push the changed data to Consumer
through long connection.Consumer
selects one of the Provider
s based on soft load balancing algorithm and executes the invocation, if fails, it will choose another Provider
.Consumer
and Provider
will count the number service invocations and time-consuming in memory, and send the statistics to Monitor
every minute.Dubbo has the following features: Connectivity, Robustness, Scalability and Upgradeability.
Register
is responsible for the registration and search of service addresses, like directory services, Provider
and Consumer
only interact with the registry during startup, and the registry does not forward requests, so it is less stressedProvider
’s and Consumer
’s memory first and then sent to Monitor
Registry
, call the provider directly according to the LB algorithm, report the time-consuming statistic to Monitor
, which includes network overheadRegister
, Provider
and Consumer
are long connections, Moniter
is an exceptionRegister
is aware of the existence of Provider
through the long connection, when Provider
gets down, Register
will push the event to Consumer
Provider
and Consumer
even all of the Register
and Monitor
get down, since Consumer
got a cache of Provider
s listRegister
and Monitor
are optional, Consumer
can connect Provider
directlyMonitor
’s downtime doesn’t affect the usage, only lose some sampling dataRegister
can return service Provider
s list to Consumer
by checking its cache, but new Provider
cannot register any servicesRegister
is a peer cluster, it will automatically switch to another when any instance goes downRegister
’s instances go down, Provider
and Consumer
can still conmunicate by checking their local cacheProvider
s are stateless, one instance’s downtime doesn’t affect the usageProvider
s of one service go down, Consumer
can not use that service, and infinitely reconnect to wait for service Provider
to recoverRegister
is a peer cluster that can dynamically increases its instances, all clients will automatically discover the new instances.Provider
is stateless, it can dynamically increases the deployment instances, and the registry will push the new service provider information to the Consumer
.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:
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 |