Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved


Chapter 8 Routing : Routing Algorithms for Target Operation Group

Routing Algorithms for Target Operation Group
This section explains the various types of supported routing algorithms for a target operation group. A target operation group type is defined based on the routing algorithm.
Example
Consider a target operation group SG1 containing three target operations as A, B, and C. The Core Engine routes the incoming facade operation requests (for example, Request 1-n) to the SG1 target operation group based on the routing key. The Core Engine selects the target operation within the SG1 target operation group based on the type of the target operation group, which are defined as follows:
LoadBalanced
If the target operation group type for the SG1 target operation group is defined as LoadBalanced, the Core Engine uses the LoadBalanced routing algorithm. For the LoadBalanced routing algorithm type, the Core Engine picks up a random target operation that is a part of this target operation group. The Core Engine distributes the requests evenly over a large number of requests.
When the Core Engine routes the client requests (Request 1-n) to SG1 target operation group with the LoadBalanced target operation group type, the target operation is selected as follows to process the client requests:
The first facade request Request 1 is forwarded to the target operation B.
The second facade request Request 2 is forwarded to the target operation C.
The third facade request Request 3 is forwarded to the target operation A.
The fourth request Request 4 is forwarded to the target operation A.
RoundRobin
If the target operation group type for the SG1 target operation group is defined as RoundRobin, the Core Engine uses the RoundRobin routing algorithm. For the RoundRobin routing algorithm type, the Core Engine selects the target operation in a RoundRobin fashion. This means that the Core Engine rotates through the list of target operations one at a time to process the client requests.
Figure RoundRobin Routing illustrates the SG1 target operation group with RoundRobin type.
When the Core Engine routes the client requests to SG1 target operation group, the target operation from the SG1 target operation group is selected as follows to process the client request:
The first facade request Request 1 is forwarded to target operation A.
The second facade request Request 2 is forwarded to target operation B.
The third facade request Request 3 is forwarded to target operation C.
The fourth request Request 4 is forwarded to target operation A. The subsequent facade requests are forwarded to target operation B, then target operation C, and so on.
Scheduling Pattern
The Core Engine uses the following scheduling pattern for the RoundRobin algorithm type:
(Target Operation A, Target Operation B, Target Operation C, Target Operation A, Target Operation B, Target Operation C, Target Operation A, and so on.)
If the selected target operation is not running or times out to process the facade request, the Core Engine processes the request as follows:
Figure 10 RoundRobin Routing
Weighted RoundRobin
For the Weighted RoundRobin routing algorithm, a weight value is assigned to each target operation. The weight value for a target operation specifies a priority for each target operation in a target operation group. You can assign a weight value to each target operation in a target operation group using the Config UI.
When you assign the weight to a target operation, the weight value indicates the capacity of that target operation in comparison to other target operations within the target operation group.
When a client request is forwarded to a target operation group type as Weighted RoundRobin, the Core Engine selects the target operation within the target operations group based on the weight values.
Figure Weighted RoundRobin shows the SG1 target operation group containing three target operations (target operation A, target operation B, and target operation C) with Weighted RoundRobin type. Target operation A is assigned weight value as 5, Target operation B is assigned weight value as 2, and Target operation C is assigned weight value as 3.
When the Core Engine routes any facade request to the SG1 target operation group, the Core Engine processes the request in the following way:
The first facade request Request 1 is forwarded to target operation A as that has the maximum weight 5.
The second facade request Request 2 is forwarded to target operation A.
The third facade request Request 3 is forwarded to target operation A.
Scheduling Pattern
The Core Engine uses the scheduling pattern as follows for the Weighted RoundRobin algorithm type:
(Target Operation A, Target Operation A, Target Operation A, Target Operation C, Target Operation A, Target Operation B, Target Operation C, and so on.)
If the selected target operation is not running or times out to process the facade request, the Core Engine processes the request as follows:
Figure 11 Weighted RoundRobin
 
RoundRobin with Failover
For a target operation group of RoundRobin With Failover type, the Core Engine selects the target operation as per the RoundRobin algorithm. See RoundRobin for details. After the target operation is selected, the Core Engine checks the health of the target operation using the HealthCheck reference functionality of TIBCO API Exchange Gateway. See HealthCheck for Reference.
The Core Engine processes the client request as follows:
Weighted RoundRobin with Failover
For a target operation group of Weighted RoundRobin With Failover type, the Core Engine selects the target operation as per the assigned weight to the target operations. See Weighted RoundRobin for details. After the target operation is selected, the Core Engine checks the health of the target operation using the HealthCheck functionality. See HealthCheck for Reference for details. If the target operation is available, the facade request is forwarded to this target operation. If the target operation is not available, the Core Engine finds an alternate target operation based on the weight assigned to the remaining target operations in the target operations group. This process continues until a target operation is found within the target operations group that is running. The facade request is routed to the available target operation for processing.
Sticky Resource Affinity
When a target operation group type is configured as Sticky Resource Affinity, the Core Engine distributes the client requests between the target operations in the target operations group based on the information such as the sticky key. When the Core Engine routes a client request to a target operation group of the Sticky Resource Affinity type, the target operation is selected based on the value of a sticky key.
Define a sticky key to route the facade operation request to a specific target operation. See Defining and Configuring Sticky Key for details.
For the SG1 target operation group with Sticky Resource Affinity type, consider the following configuration:
Sticky Routing Key SK1 is mapped to target operation A. Target operation A has processed 10 requests.
Sticky Routing Key SK2 is mapped to target operation B. Target operation B has processed 7 requests.
Sticky Routing Key SK3 is mapped to target operation C. Target operation C has processed 4 requests.
For this scenario, the Core Engine processes the client requests as follows:
Figure 12 StickyResourceAffinity Routing Algorithm
Defining and Configuring Sticky Key
To use the Sticky Resource Affinity routing algorithm, define a sticky routing key. The sticky routing key is derived in a XSLT transformation file as part of the parsing step in the request processing pipeline of a facade operation. You can upload the XSLT file for a facade operation configuration in the Config UI. The Core Engine retrieves the sticky key from the transformation. See StickyResourceAffinity Target Operation Group Configuration.

Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved