Problem Statement
A Fault tolerant load balancer that takes a configurable YAML file and redirects incoming HTTP requests to the appropriate server instance using predefined load balancing strategy.
Features
> Easily configurable using a YAML file
> Extensible Load Balancing Strategies
> Fault tolerant: Requests automatically get redirected to another instance if an instance is down
> Healthcheck UI to monitor status of servers
Tech Stack
Golang
Source Code
Key Steps/Algorithms
> Each request is made to loadbalancer running on localhost:8080/api/v1
> Request path (api/v1) is looked up to find the service it is mapped to
> All the server replicas of this service are looked up
> Load Balancing Strategies for this Service is looked up. Defaults to Round Robin
> Request is forwarded to one of these replicas using the LB strategy
Sample YAML Config File
![](https://cdn.myportfolio.com/f4283e44-84e5-44e9-9405-455edad542f4/42bdf1c0-9e32-4b9d-b724-c3465ff4f952_rw_1200.png?h=53854d9648e476fd47c9fce5fdc4a8f8)