Dubbo and Zookeeper, SPRINGMVC integration and use

Source: Internet
Author: User
Tags connection pooling zookeeper

The development of the Internet, the scale of the application of the website, the conventional vertical application architecture is unable to deal with, the distributed service architecture and the mobile computing architecture is imperative, Dubbo is a distributed service framework, which is born in this case. Now the core business is extracted, as an independent service, so that the front-end application can be more rapid and stable response.

First: Introduction Dubbo background

Dubbo is a distributed service framework that solves the problems faced above, Dubbo architecture:

Main Core components:

Remoting: The network communication framework realizes the Sync-over-async and request-response message mechanism.

RPC: Abstraction of a remote procedure call that supports load balancing, disaster recovery, and cluster functionality

Registry: Service catalog framework for service registration and service event Publishing and subscriptions

Dubbo Working principle

Provider

The exposed service party calls the service provider.

Consumer

Calling a remote service is called a "service consumer."

Registry

The service registration and Discovery Central Directory service is called the "Service registry."

Monitor

The log service for the call and call time of the statistics service is called the Service Monitoring Center.

(1) Connectivity:

Registries are responsible for registering and locating service addresses, equivalent to directory services, where service providers and consumers interact with the registry only at startup, and the registry does not forward requests and is less stressful

Monitoring Center is responsible for statistics of the number of service calls, call time, etc., statistics are first sent to the Monitoring center server every minute after the memory summary, and the report shows

The service provider registers its services with the registry and reports the call time to the Monitoring center, which does not include network overhead

The service consumer obtains the service provider address list from the registry and invokes the provider directly based on the load algorithm, reporting the call time to the Monitoring center, which includes the network overhead

Registration Center, service provider, service consumers are long connections between the three, except the monitoring center

The registry will immediately push events to inform consumers of the presence of a long-connected-aware service provider, service provider downtime

The Registry and Monitoring Center are all down, without impacting the already running providers and consumers, who cache the provider list locally

Registries and monitoring centers are optional and service consumers can connect directly to service providers

(2) Jian-like sex:

Monitoring Center outage does not affect use, just lost part of the sampled data

After the database is down, the registry can still provide a list of services through the cache, but cannot register for new services

Registration center peer cluster, after any one outage, will automatically switch to another

After the registry is all down, service providers and service consumers can still communicate via local cache

Service provider stateless, any one outage, does not affect the use of

After the service provider is all down, the service consumer app will not work and unlimited re-connect waits for the service provider to recover

(3) Flexibility:

The registry is a peer cluster that dynamically increases the machine deployment instance, and all clients will automatically discover the new registry

Service provider stateless, can dynamically increase the machine deployment instance, the registry will push the new service provider information to the consumer

Node role Description:

Provider: The service provider that exposes the service.

Consumer: Invokes the service consumer of the remote service.

Registry: Registration Center for service Registration and discovery.

Monitor: The monitoring center of the call times of the statistics service and the call time.

Container: The service runs the container.

Call Relationship Description:

The service container is responsible for starting, loading, and running the service provider.
The service provider registers its services with the registry when it is started.
When the service consumer starts, it subscribes to the registration center for the services it needs.
The registry returns a list of service provider addresses to the consumer, and if there is a change, the registry will push the change data to the consumer based on a long connection.
Service consumers, from the provider address list, based on the soft load equalization algorithm, select one provider to make the call, if the call fails, then choose another call.
Service consumers and providers, accumulate calls and call times in memory, and periodically send statistical data to the monitoring center every minute.
Built-in features (only part of the functionality is listed)

1. User management: The user is the system operator, this function mainly completes the system User Configuration.

2. Organization Management: Configuration system Organization (company, Department, Group), tree structure display, can adjust the subordinate.

Development tools

1.Eclipse IDE: Using MAVEN project management, modular.

2. Code generation: Through the interface mode simple configuration, automatically generate the corresponding code, currently includes three ways to generate (add and revise): Single table, one-to-many, tree structure. After the generated code, if you do not need to pay attention to the degree of beauty, after the build can be used.

Technology selection (only part of the technology is listed)

1, back-end

Service Framework: Dubbo, Zookeeper, rest services

Cache: Redis, Ehcache

Message middleware: ActiveMQ

Load balancing: Nginx

Distributed files: Fastdfs

Database connection pool: Alibaba Druid 1.0

Core Framework: Spring framework

Security framework: Apache Shiro 1.2

View Frame: Spring MVC 4.0

Server-side validation: Hibernate Validator 5.1

Layout frame: Sitemesh 2.4

Workflow Engine: Activiti 5.15

Task Scheduler: Quartz 1.8.5

Persistence Layer Framework: MyBatis 3.2

Log management: slf4j 1.7, log4j

Tool classes: Apache Commons, Jackson 2.2, Xstream 1.4, dozer 5.3, POI

2. Front-end

JS Frame: JQuery 1.9.

CSS Framework: Bootstrap 4 Metronic

Client-side validation: JQuery Validation Plugin.

Rich Text: Ckecitor

File Management: Ckfinder

Dynamic tab: Jerichotab

Data table: Jqgrid

dialog box: JQuery jbox

Tree structure controls: JQuery Ztree

Other components: Bootstrap 4 metronic

3. Support

Server middleware: Tomcat 6, 7, Jboss 7, WebLogic 10, WebSphere 8

Database support: Currently only support MySQL database, but not limited to the database, the next version of the upgrade multi-data source switching and database read and write separation: Oracle, SQL Server, H2, etc.

Support development environment: Eclipse, MyEclipse, Ras, idea, etc.

3. Regional management: System Urban regional model, such as: national, provincial, municipal, county and county maintenance.

4. Menu Management: Configure the System menu, Operation permissions, button permission identification and so on.

5. Role Management: Role Menu permission assignment, set role to divide data range permissions by agency.

6. Dictionary management: Maintenance of some of the more fixed data commonly used in the system, such as: whether, gender, category, level, etc.

7. Operation log: System normal operation log record and query, system exception information log record and query.

8. Connection Pooling monitoring: monitor the status of the current system database connection pool to analyze SQL to identify system performance bottlenecks.

9. Workflow Engine: Implement business order flow, online process designer.

Dubbo and Zookeeper, SPRINGMVC integration and use

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.