Dubbo-- Profile

1. What is Dubbo:

  Dubbo Alibaba open source is a high performance excellent service framework, so that the application can realize output and input functions and services through the RPC performance, it can be seamlessly integrated with the Spring Framework.

  Dubbo is a high performance, lightweight open-source Java RPC framework, which provides three core capabilities: an interface for remote method invocation, intelligent fault tolerance and load balancing, and automatic registration and service discovery.

2. Background:

  With the rapid development of Internet, Web-scale applications continue to expand, and finally we found that the traditional vertical architecture (integral) has been unable to solve. Distributed Services Architecture and stream computing architecture is imperative, urgent need for a management system to ensure the orderly development of architecture.

Overall structure

When the flow rate is very low, only one application, all functions are deployed together to reduce costs and deploy nodes. At this point, the data access framework (ORM) is to simplify CRUD workload critical.

Vertical architecture

When the flow rate increases, adding a monolithic application instance is not well faster access, a method to improve the efficiency of the application is split into discrete monolithic application. At this point, for accelerating the development of the front page Web framework (MVC) is the key.

Distributed Services Architecture

When the vertical applications rises, the interaction between the application is unavoidable, some of the core business is extracted as an independent service provider services, gradually formed a stable service center, so that the front end of the application can better in response to changing market demands. quickly. At this time, for business reuse and integration of distributed service framework (RPC) is the key.

Stream Computing Architecture

When the service rises, capacity assessment difficult, and small-scale services are often a waste of resources. To solve these problems, it should be added to the dispatch center to improve clusters and cluster capacity utilization according to traffic management. Currently, it used to improve scheduling and resource management center utilization of machines (SOA) is the key.

3. Chart:

 

Node Role Description:

  • Provider: Service Provider exposed services
  • Consumer: consumer service call services
  • Registry: service registry, responsible for service discovery and configuration
  • Monitor: the quantity and time-consuming service monitoring center, the statistical service call
  • Container: container service is running, the service life cycle management

Service relationship:

  • Container is responsible for starting, load and run the service Provider.
  • ProviderRegister when you start to its registration services.
  • Consumer starts from the beginning when the Register subscription service required.
  • Consumer Register will return a list of Providers, when it changes, Register Data Consumer connection changes by the long push.
  • Consumer and Provider selected based on one of the soft load balancing algorithm s and calling, and if that fails, it will choose another Provider.
  • Both Consumer and Provider will send calculate the number of calls in the service of memory and time-consuming, and statistics to the Monitor per minute.

4. Features

Connectivity

  • Register responsible for the registration and search services address (such as directory services), Provider and Consumer only interact with the registry during startup, and the registry does not forward the request, and therefore less pressure
  • "Monitor" is responsible for calculating the number of service calls and time consuming, statistical information will be first in memory Provider and Consumer summarized and sent to the Monitor
  • "Provider" service registration to "Register" and time-consuming statistical information (not including network overhead) reported to the "Monitor" of "consumer" address from which to obtain a list of service providers, Registry directly at algorithm according to LB providers of statistical information to be reported consuming Monitor, including network overhead
  • Register connection between, Provider and Consumer a long connection, Moniter an exception is
  • Register, Provider via a long connection aware, when disconnected Provider, Register event will push Consumer
  • It does not affect the already running instance of Provider and Consumer Register and Monitor even all get on the ground, because the resulting cache Consumer Provider list
  • Monitor Register and is optional, Consumer Provider can be directly connected

Firmness

  • Monitor downtime will not affect the use, it will lose some sample data
  • When the database server fails, Register Service Provider can return to the list by checking its cache to which the Consumer, but unable to register any new server Provider Services
  • Register a peer cluster, when any instance fails, it will automatically switch to another cluster
  • Even if all instances Register failure, Provider and Consumer still may communicate by checking its local cache
  • Service Provider are stateless, one instance of downtime will not affect the use of
  • S fault after all a service Provider, Consumer unable to use the service, and to reconnect to wait indefinitely to restore service Provider

Scalability

  • Register is a dynamically increase its instances such as clustering, all clients will automatically discover the new instance.
  • Provider is stateless, it can dynamically increase the deployment of instances, and the registry will be a new service provider information pushed to the Consumer.

Scalability

  When the further expansion of the service clusters and IT governance structure further escalation, need to dynamically deploy, and is currently distributed services architecture will not bring resistance. This is the possible future of architecture:

 

 

 

5. Use

provider.xml:

<!--暴露服务-->
<dubbo:service interface="com.xxx.XxxService" ref="xxxService"/>

<!--服务实现-->
<bean id="xxxService" class="com.xxx.XxxServiceImpl"/>

consumer.xml:

<! - references Remote Services -> 
< Dubbo: Reference the above mentioned id = "xxxService" interface = "com.xxxXxxService" />

 

Reference Dubbo official website: http://dubbo.apache.org/

Guess you like

Origin www.cnblogs.com/s-star/p/12464996.html