N. America: (800)876-3101 | World: +44 (0) 1-344-386-367

Connect for JDBC with Oracle RAC - Load Balancing

Oracle RAC systems provide two types of load balancing for automatic workload management:

  • Server load balancing distributes processing workload among Oracle RAC nodes.
  • Client load balancing distributes new connections among Oracle RAC nodes so that no one server is overwhelmed with connection requests. For example, when a connection fails over to another node because of hardware failure, client load balancing ensures that the redirected connection requests are distributed among the other nodes in the RAC.

The primary difference between these two methods is that the former method distributes processing and the latter method distributes connection attempts.

Server Load Balancing

With Oracle9i RAC systems, a listener service provides automatic load balancing across nodes. The query optimizer determines the optimal distribution of workload across the nodes in the RAC based on the number of processors and current load.

Oracle 10g also provides load-balancing options that allow the database administrator to configure rules for load balancing based on application requirements and Service Level Agreements (SLAs). For example, rules can be defined so that when Oracle 10g instances running critical services fail, the workload is automatically shifted to instances running less critical workloads. Or, rules can be defined so that Accounts Receivable services are given priority over Order Entry services.

The DataDirect Connect for JDBC Oracle driver can transparently take advantage of server load balancing provided by an Oracle RAC without any changes to the application. If you do not want to use server load balancing, you can bypass it by connecting to the service name that identifies a particular RAC node.

Client Load Balancing

Client load balancing helps distribute new connections in your environment so that no one server is overwhelmed with connection requests. When client load balancing is enabled, connection attempts are made randomly among RAC nodes. You can enable client-side load balancing for DataDirect Connect for JDBC connections through either the LoadBalancing driver property using a connection URL or data source or through the LOAD_BALANCE connect descriptor parameter in the tnsnames.ora file.

Suppose you have the Oracle RAC environment shown in Figure 5 with multiple Oracle RAC nodes, A, B, C, and D. Without client load balancing enabled, connection attempts may be front-loaded, meaning that most connection attempts would try Node A first, then Node B, and so on until a connection attempt is successful. This creates a situation where Node A and Node B can become overloaded with connection requests.

Client Load Balancing

Figure 5: Client Load Balancing

With client load balancing enabled, connection attempts are made randomly throughout the Oracle RAC system. For example, Node B may be tried first, followed by Node D, C, and A. This makes it less likely that any one node in the Oracle RAC system will be so overwhelmed with connection requests that it may start refusing connections.

For example, the following connection URL enables client load balancing for the DataDirect Connect for JDBC Oracle driver:

jdbc:datadirect:oracle//server1:1521;ServiceName=TEST;AlternateServers=
(server2:1521,server3:1521,server4:1521);LoadBalancing=true

 

Prev: Failover

Next: Summary

Email Print Share

Using DataDirect Connect for JDBC with Oracle RAC

Tutorial: Testing and Debugging JDBC Applications Would you rather have the PDF version of this Tutorial? No Problem!

Click here to download the PDF version of Using DataDirect Connect for JDBC with Oracle RAC