6.5 Clustering
Clustering
OC4J instances allows Oracle
Application Server to solve both hardware and software reliability
and scalability problems. Oracle
Application Server can group two or more OC4J instances into a
cluster, whether or not they reside on the same host. Clustered OC4J
instances appear to the outside world as one application server,
providing high reliability and almost unlimited scalability.Various load-balancing mechanisms are
available to direct incoming requests between clustered OC4J
instances. If one clustered instance fails, another picks up where it
left off, using the appropriate load-balancing mechanism. Clustering
OC4J instances across hosts solves both the hardware and software
reliability problems. The bulk of what clustering is and how it is
employed in Oracle Application Server was covered in Chapter 2, but a few relevant
J2EE issues are discussed in this section.OC4J provides stateful failover for clusters via HTTP
session object and EJB state replication. This
means that each user's session, and each
EJB's state, is replicated between OC4J instances.The HTTP session objects in a web (servlet) container are selectively
replicated across all OC4J
instances that are part of the same cluster and processes that are
part of the same island. An OC4J
island is a way to
group one or more OC4J JVM processes. Rather than having to replicate
HTTP session objects among all OC4J processes (which can be very
resource-intensive), islands allow selective replication. This
fine-grained control prevents replication within a cluster from
degrading OC4J's performance.EJB state replication is handled
differently. Because of the nature of EJBsthey are all
independent componentsEJB state is replicated between all OC4J
instances in a cluster. There is no fine-grained replication control
mechanism.