Skip to content

SaketV8/orbit-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Orbit-Go

A lightweight, high-performance load balancer written in Go

Orbit-Go is a simple, fast, and extensible load balancer built with Go. It is designed to efficiently distribute traffic across multiple backend services while remaining easy to configure and deploy.

🚀 Features

  • High-performance load balancing using Go’s concurrency model
  • Multiple load balancing strategies (round-robin, least-connections, iphash, weighted-round-robin etc.)
  • Health checks for backend services
  • Configurable via file or environment variables
  • Minimal dependencies and small binary size

🏗️ Architecture

The following diagram illustrates the high-level architecture of Orbit-Go.

Orbit-Go architecture diagram

📖 Prerequisites:

⚡ Run on your machine

git clone https://github.com/saketv8/orbit-go.git
cd orbit-go

# install dependencies
go mod download

go build -o orbit-go

in one terminal

cd examples

# start the example backend
task run-all

and then in another terminal

# start the main orbit-go server
./orbit-go

🖥️ Orbit-Go in Action

Orbit-Go in action gif

⚙️ Configuration

Orbit can be configured using a configuration config.yaml

Example config.yaml

# config for orbit-go
application:
  name: orbit-go
  version: v0.0.1

# orbit-go server config
server:
  port: 8000
  # available strategies - roundrobin(rr), leastconnection, iphash, weighted-roundrobin (wrr), random
  strategy: "roundrobin"

# available backend
backends:
  - url: "http://localhost:8081"
    weight: 1
  - url: "http://localhost:8082"
    weight: 3
  - url: "http://localhost:8083"
  - url: "http://localhost:8084"

health_check:
  interval: 5s
  timeout: 100s

🧭 About

This project was created to learn Golang and how HTTP works in Go, while applying Go best practices to write scalable, idiomatic code using goroutines, with a focus on networking fundamentals at the OSI Layer 7 level

Status

🌱 Todo / Future Improvements

  • support config.yaml
  • Support multiple load balancing strategies
  • IP hash strategy based on cookies
  • Health checker for backend services
  • Add and remove backends at runtime without restarting Orbit
  • Graceful shutdown of load balancing server
  • Admin panel (Web UI) — 50% complete (in progress)
  • Prometheus metrics
  • Improved error handling and retries
  • Configuration hot-reload

About

A lightweight load balancer written in Go

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages