The principle of using dubbo

Dubbo is a high-performance and excellent server framework of Alibaba's open source code, which enables applications to realize the input and output functions of services through high-performance RPC, and can inherit from spring.

The above works:

Provider

The exposed service party is called a " service provider " .

Consumer

The party calling a remote service is called a " service consumer " .

Registry

The central directory service for service registration and discovery is called the " Service Registry " .

Monitor

The log service that counts the invocation times and invocation time of the service is called " service monitoring center " .

(1) Connectivity:

The registration center is responsible for the registration and search of service addresses, which is equivalent to a directory service . Service providers and consumers only interact with the registration center at startup. The registration center does not forward requests, so the pressure is small.

The monitoring center is responsible for counting the number of calls and calling time of each service. The statistics are first aggregated in memory and then sent to the monitoring center server every minute, and displayed in a report.

The service provider registers the services it provides with the registration center, and reports the calling time to the monitoring center, which does not include network overhead

The service consumer obtains the address list of service providers from the registration center, directly calls the provider according to the load algorithm, and reports the calling time to the monitoring center, which includes network overhead.

The registration center, service provider, and service consumer are all long-term connections, except for the monitoring center

The registration center perceives the existence of the service provider through the long connection . If the service provider is down, the registration center will immediately push the event to notify the consumer

The registration center and monitoring center are all down, which does not affect the running providers and consumers. The consumer caches the provider list locally.

The registration center and monitoring center are optional, and service consumers can directly connect to service providers

(2) Robustness:

The downtime of the monitoring center does not affect the use, but only part of the sampled data is lost

After the database is down, the registry can still provide service list query through the cache , but cannot register new services

Registry center peer-to-peer cluster , after any one goes down, it will automatically switch to another

After all the registries are down, service providers and service consumers can still communicate through the local cache

The service provider is stateless. After any one goes down, it will not affect the use.

After all service providers are down, the service consumer application will be unavailable, and will reconnect infinite times waiting for the service provider to recover

(3) Scalability:

The registry is a peer-to-peer cluster, which can dynamically increase machine deployment instances, and all clients will automatically discover the new registry

Service providers are stateless and can dynamically add machine deployment instances, and the registry will push new service provider information to consumers

Guess you like

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