Routing Algorithms

Learn how to configure routing algorithms for your routing strategies.


Routing Strategies in Ironforge provide flexible control over how requests are distributed across your RPC endpoints. Each strategy can be configured with one of three sophisticated routing algorithms, each designed to address specific use cases and requirements:

  • Sequential: Provides failover capabilities by trying endpoints in a predefined order
  • Parallel: Optimizes for speed by making concurrent requests to all endpoints
  • Weighted: Distributes traffic proportionally based on assigned weights with failover support

These algorithms allow you to fine-tune how your traffic is handled based on your specific needs, whether that's optimizing for reliability, speed, or controlled load distribution. Let's explore each algorithm in detail:

Sequential

When a request is made, Ironforge forwards it to the first available RPC endpoint in the configured list.

If the first endpoint responds successfully, Ironforge uses that response. However, if the first endpoint encounters an error or is unavailable, Ironforge automatically moves to the next available endpoint in the sequence. This process continues until a successful response is obtained or all endpoints have been attempted.

You can set the order of the endpoints which should be used for the Sequential algorithm via the user interface.

Parallel

The Parallel routing algorithm is designed for maximizing performance and responsiveness.

When a request is received, Ironforge simultaneously sends it to all available RPC endpoints. Ironforge then uses the response from the first endpoint that responds successfully, discarding the responses from the remaining endpoints. This approach leverages parallel processing to reduce response times.

However, it's important to note that the Parallel algorithm may incur higher costs due to the increased utilization.

Weighted

Weighted routing is a load balancing algorithm that allows you to assign a weight to each RPC endpoint. This weight is used to determine the proportion of traffic that should be directed to each endpoint.

When using weighted routing, we also allow defining a set of failover endpoints. If the primary endpoint, which is randomly selected using the weights assigned, fails to give a valid response, the load balancer will fallback to the failover endpoints.