Discussion on Java EE Cluster Technology--Part II (what is the cluster of Java EE) __java

Source: Internet
Author: User
Tags failover
Java EE Cluster   Generally speaking, Java EE cluster technology includes "load Balancing" and "failover" two parts.   In the above illustration, load balancing means that a target object is requested by many client objects simultaneously. The load balancer is between the caller and the callee, and you can distribute the request to a target object with the same functionality but different locations. Both high performance and high availability can be achieved in this way.   As shown above, failover works differently from load balancing. Typically, a client object can successfully request a target object. If the target object fails during the request process, the failover system monitors the failure and redirects subsequent requests to another available object. Fault tolerance can be achieved in this way.   So, what types of objects can be clustered? How do you represent the point of load balancing and failover in Java code? In fact, not all objects can be clustered, and load balancing and failover cannot occur on any line of Java code.   View the above code. The code for the Business () method in class A can be transferred by load balancing or failure. Our answer is no. For load balancing and failover, it is necessary to have a listener between the caller and the callee responsible for distributing or redirecting method calls to different objects. Objects A and B are running in the same JVM and are tightly interconnected, and it is difficult to add a distribution logic between the method calls.   So, what types of objects can be clustered together. The answer is that only those component objects that can be deployed in a distributed topology environment.   So, when does the behavior of load balancing and failure transfer occur? The answer is only when you call a method of a distributed object.     as shown in the figure above, in a distributed environment, the caller and the callee are explicitly delimited in different run-time containers. Can be separated by different jvms, processes, or computers.   Executes a method (so called "distributed") in the target object's container when the client invokes the target object. Client and target objects communicate through standard network protocols. With these features, you can use mechanisms to intervene the path of the method invocation to achieve load balancing and failover.   In the above illustration, browsers may invoke remote JSP objects through the HTTP protocol. The JSP executes on the WEB server, and the browser does not care about the execution, it waits only for results. In this case, you can add components to the browser and WEB server that implement load balancing and failover capabilities. In Java EE,Distributed technologies include: JSP (Servlet), JDBC, EJB, JNDI, Web services, and so on. Load balancing and failover occur when these distributed methods are invoked. Let's delve into the technical details below. Java EE cluster Technical Reference documentation download
Related Article

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.