How to deploy J2EE layered server

The advantage of developing layering is that,

(1) Reduce coupling, access through interface specifications, improve efficiency and sharing efficiency, and can be well cut for the calling layer without knowing the underlying implementation.

  Layering: It is divided into code-level layering and server-level layering.

The advantage of layering at the code level is to reduce coupling. The upper layer depends on the lower layer, and the lower layer is accessed through the interface without knowing the interface implementation.

The server-level stratification is to enhance the load capacity of the upper layer, so as to avoid taking up too many resources due to a service in the service layer relatively consuming resources under the same server, resulting in other requests waiting to be executed, resulting in a relatively slow response. The service layer server is accessed through the web layer, so that the services that occupy more resources are placed on the independent server, thereby improving the access efficiency of the web layer. Some web access services are very simple and can be responded quickly, but are relatively slow, and may not need to access the service layer, or the service layer calls the service layer in a cluster responsible way, which greatly improves the access efficiency.

 

For example, according to the three-tier access of web->service->dao, the architecture evolves

(1) Deployed in the server Server-A, it is ok if the action directly calls the service in the same virtual machine.

If Server-A supports a maximum of 100 concurrent requests, then if 10 users submit an order, deduct money, and generate a mirror image file, it consumes more resources and occupies 98% of the CPU. At this time, the other 90 login requests access the server, and this At this time, because the CPU occupies too much resources, another 90 requests will be waiting, and the efficiency of the 10 requests executed at this time is completed, so the user experience is very poor.

(2) At this time, we will consider adding a web server, but after the user access concurrency increases, it will bring the same problem

(3) If it is found that the business of submitting the order occupies more resources, then the service layer that occupies the resources is separated into a separate application server, and the service is invoked through SOA.

(4) In this way, the web application server can process the client's request response relatively quickly, and the individual services that occupy resources are executed in a separate server, and the pressure of occupied resources in the webserver is distributed to a separate application server. At the same time, the server of the service layer can also respond to the service in a cluster manner.

 

benefit:

     Reduce the time slice of resource consumption in the web application server.

     Enhance the access throughput of the web application server layer.

     The independent service layer can provide better services, and can provide services through clusters to increase throughput

    It can greatly enhance the stability, safety and efficiency of the system.

The web layer goes through the cluster, the service layer goes through the cluster, and so on.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327074878&siteId=291194637