Benefits of Multi-Tier Architecture Load Balancing Clustered Objects in a in Multi-Tier Architecture

Cluster Architectures 9-5 Figure 9–2 Recommended Multi-Tier Architecture

9.3.1 Physical Hardware and Software Layers

In the Recommended Multi-Tier Architecture the application tiers are hosted on two separate physical layers of hardware and software.

9.3.1.1 WebPresentation Layer

The Webpresentation layer consists of a cluster of WebLogic Server instances dedicated to hosting static HTTP pages, servlets, and JSPs. This servlet cluster does not host clustered objects. Instead, servlets in the presentation tier cluster act as clients for clustered objects, which reside on an separate WebLogic Server cluster in the object layer.

9.3.1.2 Object Layer

The object layer consists of a cluster of WebLogic Server instances that hosts only clustered objects—EJBs and RMI objects as necessary for the Web application. By hosting the object tier on a dedicated cluster, you lose the default collocation optimization for accessing clustered objects described in Section 5.2.6, Optimization for Collocated Objects. However, you gain the ability to load balance on each method call to certain clustered objects, as described in the following section.

9.3.2 Benefits of Multi-Tier Architecture

The multi-tier architecture provides these advantages: ■ Load Balancing EJB Methods By hosting servlets and EJBs on separate clusters, servlet method calls to EJBs can be load balanced across multiple servers. This process is described in detail in Section 9.3.3, Load Balancing Clustered Objects in a in Multi-Tier Architecture. ■ Improved Server Load Balancing 9-6 Using Clusters for Oracle WebLogic Server Separating the presentation and object tiers onto separate clusters provides more options for distributing the load of the Web application. For example, if the application accesses HTTP and servlet content more often than EJB content, you can use a large number of WebLogic Server instances in the presentation tier cluster to concentrate access to a smaller number of servers hosting EJBs. ■ Higher Availability By utilizing additional WebLogic Server instances, the multi-tier architecture has fewer points of failure than the basic cluster architecture. For example, if a WebLogic Server that hosts EJBs fails, the HTTP- and servlet-hosting capacity of the Web application is not affected. ■ Improved Security Options By separating the presentation and object tiers onto separate clusters, you can use a firewall policy that places only the servletJSP cluster in the DMZ. Servers hosting clustered objects can be further protected by denying direct access from untrusted clients. For more information, see Section 9.5, Security Options for Cluster Architectures.

9.3.3 Load Balancing Clustered Objects in a in Multi-Tier Architecture

WebLogic Servers collocation optimization for clustered objects, described in Section 5.2.6, Optimization for Collocated Objects, relies on having a clustered object the EJB or RMI class hosted on the same server instance as the replica-aware stub that calls the object. The net effect of isolating the object tier is that no client HTTP client, Java client, or servlet ever acquires a replica-aware stub on the same server that hosts the clustered object. Because of this, WebLogic Server cannot use its collocation optimization described in Section 5.2.6, Optimization for Collocated Objects. , and servlet calls to clustered objects are automatically load balanced according to the logic contained in the replica-aware stub. Figure 9–3 depicts a client accessing a clustered EJB instance in the multi-tier architecture. Cluster Architectures 9-7 Figure 9–3 Load Balancing Objects in a Multi-Tier Architecture Tracing the path of the client connection, you can see the implication of isolating the object tier onto separate hardware and software: 1. An HTTP client connects to one of several WebLogic Server instances in the Webservlet cluster, going through a load balancer to reach the initial server. 2. The client accesses a servlet hosted on the WebLogic Server cluster. 3. The servlet acts as a client to clustered objects required by the Web application. In the example above, the servlet accesses a stateless session EJB. The servlet looks up the EJB on the WebLogic Server cluster that hosts clustered objects. The servlet obtains a replica-aware stub for the bean, which lists the addresses of all servers that host the bean, as well as the load balancing logic for accessing bean replicas. 4. When the servlet next accesses the EJB for example, in response to another client, it uses the load-balancing logic present in the beans stub to locate a replica. In the example above, multiple method calls are directed using the round-robin algorithm for load balancing. In this example, if the same WebLogic Server cluster hosted both servlets and EJBs as in Section 9.2, Recommended Basic Architecture , WebLogic Server would not load balance requests for the EJB. Instead, the servlet would always invoke methods on the EJB replica hosted on the local server. Using the local EJB instance is more efficient than making remote method calls to an EJB on another server. However, the multi-tier Note: EJB replica-aware stubs and EJB home load algorithms are specified using elements of the EJB deployment descriptor. See weblogic-ejb-jar.xml Deployment Descriptor Reference in Programming WebLogic Enterprise JavaBeans for Oracle WebLogic Server for more information. 9-8 Using Clusters for Oracle WebLogic Server architecture enables remote EJB access for applications that require load balancing for EJB method calls.

9.3.4 Configuration Considerations for Multi-Tier Architecture