Combined-Tier Architecture

The multi-tier architecture illustrated earlier in Figure 14-2 provides many benefits, such as the opportunity to load-balance at the EJB level, and the freedom to add further WebLogic instances at either the presentation or object tier. Simpler cluster architectures can be designed by combining the web/presentation and object tiers into a single WebLogic cluster. This means deploying the entire application (including servlets, JSPs, EJBs, RMI objects, JDBC, and JMS resources) homogeneously across all members of the WebLogic cluster. Figure 14-8 depicts the layout of the combined-tier architecture. Here, each server instance in the tier hosts all of the aforementioned services, including the HTTP server.

Figure 14-8. Combined-tier architecture

An obvious benefit of such an architecture is the ease with which it can be constructed and administered. You can deploy your application and its components to all members of the cluster. The network configuration of this setup also is simplified, as are your security considerations. By placing a firewall before the load balancer, you can set up a DMZ for your application quite simply. If you need to disable direct access to your EJB objects, you also can configure WebLogic to disable all external T3/IIOP requests to the cluster.

The combined-tier architecture also performs quite well. Because servlets and EJBs are deployed homogeneously across the cluster, all EJB objects are collocated with servlets. This means any call from a servlet to an EJB object is forwarded automatically to a local replica of the EJB, and not to a remote replica of the same EJB. The same optimization occurs when an EJB invokes a method on another EJB.

However, this performance gain also comes with certain trade-offs in terms of limiting the flexibility of your architecture. The combined-tier framework limits the load-balancing and failover capabilities of the cluster. Load balancing cannot occur on EJB method calls because the local copy of the EJB object always will be preferred over a remote EJB instance on another cluster member. In addition, all of your eggs are in one basket. If a server instance fails, all services on that instance will become unavailable. Likewise, if you find that most of your processing occurs at the EJB level, the additional server instance must host the same services as the other cluster members. It can't be used solely to boost the capacity of your EJBs.

In general, WebLogic supports load balancing at the interfaces between the tiers. The multi-tier architecture maintains physical separation between the presentation tier and the object tier, thereby providing load-balancing and failover opportunities. The combined architecture, however, offers load balancing and failover only at the interface to the web tier. It is ideal for web applications, and even suited to small-scale enterprise applications where load balancing and failover at the object tier is not an essential requirement. In addition, you need to evaluate the cost of administering a multi-tier setup if this outweighs the cost of maintaining the application, a combined-tier setup may be an affordable option. If the network overhead incurred due to invocations between the presentation and object tiers yields unacceptable performance, a combined-tier setup with its collocation of services may offer better performance than a multi-tier architecture.

Категории