Skip to main content

How It Works

Client → UltraBalancer → Backend Servers

         Health Checks

         Metrics (Prometheus)

Core Components

ComponentDescription
Proxy ServerAccepts requests, routes to backends
Load BalancerAlgorithm for backend selection
Backend PoolManages server list and health
Health CheckerMonitors backend availability
MetricsTracks performance data

Request Flow

  1. Client sends request to UltraBalancer
  2. Rate limiting check (if enabled)
  3. Select backend using algorithm
  4. Proxy request to backend
  5. Stream response back to client
  6. Record metrics

Algorithms

  • Round Robin - Equal distribution
  • Least Connections - Fewest active connections
  • IP Hash - Consistent client-to-backend mapping
  • Weighted - Based on backend weight
  • Random - Random selection
  • Power of Two - Pick 2, use least loaded
  • Fastest Response - Lowest latency backend

Data Flow

HTTP Request

Parse Request

Extract Client IP

Check Rate Limit

Select Backend (algorithm)

Proxy to Backend

Stream Response

Update Metrics

Tech Stack

  • Runtime: Tokio (async)
  • HTTP: Hyper
  • TLS: Rustls
  • Serialization: Serde