Skip to main content

Load Balancing

GoZen supports several provider selection strategies beyond basic failover. You can choose a strategy per profile, combine it with health checks, and steer traffic based on availability, latency, or cost.

Available strategies

Failover

Try providers in order until one succeeds. This is the default strategy and works well for primary/backup setups.

{
"profiles": {
"default": {
"providers": ["primary", "backup"],
"strategy": "failover"
}
}
}

Round robin

Distribute requests evenly across multiple equivalent providers.

{
"profiles": {
"balanced": {
"providers": ["provider-a", "provider-b", "provider-c"],
"strategy": "round-robin"
}
}
}

Least latency

Prefer the provider with the lowest recent response time.

{
"profiles": {
"fast": {
"providers": ["us-east", "us-west", "eu"],
"strategy": "least-latency"
}
}
}

Least cost

Prefer the cheapest provider for the requested model.

{
"profiles": {
"budget": {
"providers": ["cheap-provider", "premium-provider"],
"strategy": "least-cost"
}
}
}

Health-aware routing

All strategies can work with health monitoring. When health_aware is enabled, unhealthy providers are skipped automatically until they recover.

{
"profiles": {
"production": {
"providers": ["primary", "secondary", "tertiary"],
"strategy": "least-latency",
"health_aware": true
}
}
}

Choosing a strategy

  • Use failover for reliability-first routing.
  • Use round-robin when providers are interchangeable.
  • Use least-latency for interactive or time-sensitive workloads.
  • Use least-cost when budget matters more than raw speed.
  • Profiles explains how provider groups are defined.
  • Routing covers scenario-based provider selection.
  • Health Monitoring explains how health checks affect routing.