Yicufang Mall Architecture Summary

iCube Mall Architecture

Distributed + SOA

 

What is distributed?

       A complete system is divided into several independent subsystems according to function points, each subsystem can be called a node, and each node can be configured with multiple servers (clusters) independently, and each subsystem interacts with each other. Communication, coordination and cooperation, together to complete the business process of the entire system, this is distributed.

 

What is a cluster?

       Multiple servers doing the same thing, this is a cluster.

 

Why use distributed?

Answer: For the simplest web project, its architecture may be presentation layer - > business layer - > persistence layer - > database . The entire project is deployed to a Tomcat . A Tomcat server theoretically supports 500 concurrency, 1,000 concurrency requires 2 Tomcat , and 10,000 concurrency requires 20 servers for tomcat cluster. It stands to reason that the high concurrency problem can also be solved by continuously adding Tomcat servers. But any project should have the function of user login, which will inevitably involve the problem of session replication. Tomcat itself has the function of session sharing. Because of Seesion replication, the number of nodes in the tomcat cluster continues to increase, and its service capacity will first increase and then decrease.5 servers will work best. We say that the problems that can be solved by hardware do not need to be solved by software, but when the hardware cannot be solved, it can only be solved by software.

  Therefore, we use distributed, split the entire system into several independent subsystems according to function points, and then configure the cluster separately according to the business access volume of each subsystem. For example, the concurrency of the home page is high, and the concurrency of the order page is only will be relatively low. In addition, the distributed problem of session replication is mentioned in one subsystem, that is, the single sign-on system. If other subsystems do not have the problem of session replication, there is no limit to the number of servers in the cluster.

 

What are the subsystems that are disassembled after the project is distributed?

A: Front-end system, back-end management system, shopping cart system, order system, search system, single sign-on system.

 

What are the advantages of being distributed?

Answer : 1. Divide the whole system into different modules, and use interface communication between modules to reduce the coupling between modules

2. Divide a project into several sub-projects so that different teams are responsible for different sub-projects

3. When a new function is added, you only need to add another sub-project and call the interface of other sub-projects.

4. Flexible distributed deployment

 

What are the disadvantages of distributed?

Answer: 1. Remote communication is required for interaction between systems, and interface development increases the workload

       2. Each module has some general business logic that cannot be shared

 

       For example, the home page in the front-end system needs to display the product, need to query the product information, the order also needs to display the product, and also need to query the product information . . But can this business logic be shared now? can not. In different projects, you cannot share them. You can only make one copy of this project, one copy of that project, and two copies. Well, we want to share these business logics. How can it be shared?

So we introduce the architecture of        soa on a distributed basis .

 

       SOA : Service Oriented Architecture Service Oriented Architecture . That is, the project is divided into two projects: the service layer and the presentation layer. The service layer contains business logic and only needs to provide external services. The presentation layer only needs to deal with the interaction with the page, and the business logic is implemented by calling the services of the service layer.

 

       The communication between systems is achieved through dubbo .

 

Can you briefly introduce the architecture of dubbo ?

answer:


       Dubbo is a service governance tool. Provides a unified entry for all services.

       The Dubbo architecture includes five roles, namely: Container , Provider , Registry , Consumer , Monitor . Among them, Container is a container, which can be Spring ; Provider is a service provider, Registry is a registry, Consumer is a service caller, and Monitor is a monitoring center.

       The execution flow is as follows:

       1.  When initializing the container, the Provider publishes the service;

       2. Provider registers the published services in the registry ;

       3. Consumer pre-calls the service and first asks the registry center if the service has been released. If so, the registry center returns the address of the service ( ip + port number) to the consumer .

       4. Consumer gets the address of the pre-invoked service and directly invokes the service

       5.  The client and the server accumulate the number and time of calling the service in memory, and regularly send the statistical data to the monitoring center Monitor .

 

       The implementation of Dubbo only needs to import the corresponding jar package. If the server needs to publish the service, and the client needs to call the service, it needs to import the jar package.

       Both Zookeeper and Monitor are independent service software that need to be installed under the Linux system.

 

 

 

 

 

 

 

 

 

 

 

 

Guess you like

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